Hello everyone,I have one questions about strategy writing。。。
The execution command is like this:
function enter(BuySell)
......
valuemap=core.valuemap();
valuemap.Command="CreateOrder";
......
success,msg=terminal:execute(2000,valuemap);
if not(success) then executing=false;
terminal:alertMessage(instance.bid:instrument(),instance.bid[NOW],"Open order failed"..msg,instance.bid:date(NOW));
else terminal:alertMessage(instance.bid:instrument(),instance.bid[NOW],"Open order true"..msg,instance.bid:date(NOW));
end
end
that how to write “function ExtAsyncOperationFinished()”?。。。
First kind:
function ExtAsyncOperationFinished(cookie,success,message)
if cookie==2000 and not(success) then
terminal:alertMessage(instance.bid:instrument(),instance.bid[NOW],"Open order failed"..message,instance.bid:date(NOW));
end
end
Second kinds:
function ExtAsyncOperationFinished(id,success,message)
if id==2000 and not(success) then
terminal:alertMessage(instance.bid:instrument(),instance.bid[NOW],"Open order failed"..message,instance.bid:date(NOW));
end
end
Questions1:How to write “function ExtAsyncOperationFinished()”?
Questions2:Is the effect of the two writing the same?
Questions3:The “cookie” is Specific time for second?
thank you verymuch!