I solved it by changing https to http.
Also added string data "123" (any number), otherwise new position is not opened, server responds with confirmation of previously opened trade.
// ------------------------- Trade4me/binary.com API
function main()
{
char ip_str[100]; // just a long empty string
int id = http_post("http://trade4.me/order.php?username=Fiber100&password=Awainter1t&asset=EUR/USD&direction=UP&expiry=1&amount=10&rand=","123");
if(!id) return;
while(!http_status(id)) {
if(!wait(100)) return; // wait for the server to reply
printf(".");
} if(http_status(id) > 0) { //transfer successful?
http_result(id,ip_str,100); //get the replied IP
printf("n%s",ip_str);
} else
printf("nError during transfer!");
http_free(id); //always clean up the id!
}
Only thing I couldn't resolve how to insert variables into http for instrument, direction, duration and stake.
Error in 'line 11:
Can not convert '' to 'ARRAY'
// ------------------------- Trade4me/binary.com API
function main()
{
char ip_str[100]; // just a long empty string
string Instr = "EUR/USD";
string Direction = "UP";
string Exp = "1";
string Size = "10";
int id = http_post("http://trade4.me/order.php?username=Fiber100&password=Awainter1t&asset="+Instr+"&direction="+Direction+"&expiry="+Exp+"&amount="+Size+"&rand=","123");
if(!id) return;
while(!http_status(id)) {
if(!wait(100)) return; // wait for the server to reply
printf(".");
} if(http_status(id) > 0) { //transfer successful?
http_result(id,ip_str,100); //get the replied IP
printf("n%s",ip_str);
} else
printf("nError during transfer!");
http_free(id); //always clean up the id!
}