Is it possible to add a wait(milliseconds) function ?

All posts which do not fit into any other sections of the forum.

Moderator: admin

Is it possible to add a wait(milliseconds) function ?

Postby PascalFXCM » Sun Jan 01, 2012 5:47 pm

Hi, my name is Pascal and i'm new on the forum.
I'm actually developping my own strategy and i would like to know if it is possible to add a 'wait' like-funtion in my ExtUpdate(id, source, period) function of my strategy strategy?

For example i want to test the ask price NOW with a delayed ask price:

local Cw1 = instance.ask[instance.ask:size() - 1];

if (Cw1 < MaxValue) then
wait(5000);
local Cw2 = instance.ask[instance.ask:size() - 1];
if (Cw2 > Cw1) then
...
end
end


Is it possible to do such thing in a strategy working in fixed time frame m15?

I use 2 indicators in m15,
their values are updated only every 15 minutes ?

Thank you very much for your precious help !
PascalFXCM
 
Posts: 6
Joined: Sun Jan 01, 2012 5:34 pm

Re: Is it possible to add a wait(milliseconds) function ?

Postby Apprentice » Mon Jan 02, 2012 4:35 am

Example of, Time delay can be found in the example of this strategy.
download/file.php?id=4802
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 26566
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Is it possible to add a wait(milliseconds) function ?

Postby PascalFXCM » Mon Jan 02, 2012 6:00 am

Thanks a lot, ;) xx Pascal
PascalFXCM
 
Posts: 6
Joined: Sun Jan 01, 2012 5:34 pm


Return to General Discussions

Who is online

Users browsing this forum: No registered users and 3 guests