How can make code work every second ???

 

Hello every one .

We know the code in neta trader work every receive signal , can we make the code work every second or until receive signal , whatever earlieset .

thank you very much .

 

There is no way I know of apart from examining the time stamps on the incoming ticks, why would you want to perform an action when you have no new data anyway?

 
Craig:
There is no way I know of apart from examining the time stamps on the incoming ticks, why would you want to perform an action when you have no new data anyway?

oh my dear , thank you very much that you helping me .

in fact I want send and modify multi orders in each time , and as you see , I can made one every new data , can I send and modify multi orders in one time ?????

thank you again .

 

You can make an expert run every number of miliseconds, using infinite while loop in Init(). Look below for an example.

int init()

{

if (IsExpertEnabled() == true)

{

if (IsTradeAllowed() == true)

{

while (true)

{

//------Your code here---

Sleep(1000);

}

}

}

return(0);

}

int start()

{

return(0);

}

It will run aproximately every second.

Wookey

 
wookey:
You can make an expert run every number of miliseconds, using infinite while loop in Init(). Look below for an example.

int init()

{

if (IsExpertEnabled() == true)

{

if (IsTradeAllowed() == true)

{

while (true)

{

//------Your code here---

Sleep(1000);

}

}

}

return(0);

}

int start()

{

return(0);

}

It will run aproximately every second.

Wookey

Oh thank you very much Wookey , I will test the code .

Reason: