Posted By: Fiber
Http function script for trading API - 12/05/16 19:50
I'm trying to sent http line to open position.
API description and example - https://trade4.me/API/
My Url:
https://trade4.me/order.php?username=Fib...=1&amount=1
It's demo account, you can test.
If I insert it to the browser window it works fine and I get respond:
Signal Successfully Traded : ID 11292781628, Open Price 0, Open Time 2016-12-05 19:36:36, Expiry Time 2016-12-05 19:37:36
I tried to use script from Zorro Manual example, but got message "Error during transfer!"
Also I tried to use http_send, or remove all code and leave only http_post command, but without success.
Any ideas to solve it?
API description and example - https://trade4.me/API/
My Url:
https://trade4.me/order.php?username=Fib...=1&amount=1
It's demo account, you can test.
If I insert it to the browser window it works fine and I get respond:
Signal Successfully Traded : ID 11292781628, Open Price 0, Open Time 2016-12-05 19:36:36, Expiry Time 2016-12-05 19:37:36
I tried to use script from Zorro Manual example, but got message "Error during transfer!"
Also I tried to use http_send, or remove all code and leave only http_post command, but without success.
Any ideas to solve it?
Code:
void main() { char ip_str[200]; // just a long empty string int id = http_post("https://trade4.me/order.php?username=Fiber100&password=Awainter1t&asset=EUR/USD&direction=UP&expiry=1&amount=1",0); 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,200); //get the replied IP printf("n%s",ip_str); } else printf("nError during transfer!"); http_free(id); //always clean up the id!} }