// ------------------------- Trade4me/binary.com API - 2
function Trade4me( string Instrument, string Direction, string Exp, string Size)
{
char ip_str[100]; // just a long empty string
string httpline[200];
sprintf(httpline,"http://trade4.me/order.php?username=Fiber100&password=Awainter1t&asset=%s&direction=%s&expiry=%s&amount=%s&rand=",Instrument,Direction,Exp,Size);
int id = http_post(httpline,"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!
}
function main()
{
Trade4me ("EUR/USD","UP","5","10");
}