Someone has written an API to a trade log database so that I can send trade calls via HTTP. I'm not really a web guy but this does seem very basic.
If I paste the following URL into my browser's address bar everything works perfectly:
"http://service.livetradingfloor.com/restapi/index.php/api/mwmf/addTradeCall/tid/12/setup/35/epic/GBPUSD/sector/-2-/direction/1/entry/3456/stoploss/3450/target/3464/ordertype/1/status/1"_
so why doesn't the following script work.
var reset = 0;
function main() {
if (reset == 0) reset=call();
return;
}
function call() {
HTTP("http://service.livetradingfloor.com/restapi/index.php/api/mwmf/addTradeCall/tid/12/setup/35/epic/GBPUSD/sector/-2-/direction/1/entry/3456/stoploss/3450/target/3464/ordertype/1/status/1");
Alert.addToList(getSymbol(), "DONE", Color.red, Color.white);
Alert.playSound("beep.wav");
return 1;
}
Have I done something wrong and if so what? If not, how can I accomplish this.
Please help - I'm desperate.
Thank you.
If I paste the following URL into my browser's address bar everything works perfectly:
"http://service.livetradingfloor.com/restapi/index.php/api/mwmf/addTradeCall/tid/12/setup/35/epic/GBPUSD/sector/-2-/direction/1/entry/3456/stoploss/3450/target/3464/ordertype/1/status/1"_
so why doesn't the following script work.
var reset = 0;
function main() {
if (reset == 0) reset=call();
return;
}
function call() {
HTTP("http://service.livetradingfloor.com/restapi/index.php/api/mwmf/addTradeCall/tid/12/setup/35/epic/GBPUSD/sector/-2-/direction/1/entry/3456/stoploss/3450/target/3464/ordertype/1/status/1");
Alert.addToList(getSymbol(), "DONE", Color.red, Color.white);
Alert.playSound("beep.wav");
return 1;
}
Have I done something wrong and if so what? If not, how can I accomplish this.
Please help - I'm desperate.
Thank you.
Comment