I add this code before conditions for trade, but this is not correct, can you help me,
if(OrderSelect(0,SELECT_BY_POS,MODE_HISTORY)==true)
if(OrderCloseTime()>0)
if(OrderCloseTime()<iTime(NULL,0,0))
{ bool trade = True;}
i will tell you how i do this. I use variable Bars that returns number of bars in the current chart. I find it very handy here as it changes it's value everytime with new bar
1. create variable (for example) int currBars
2. use such expression:
if (currBars!=Bars)
{
//insert here anything you want to run only once per each candle, it will be executed at the begging of each candle, at the first tick
currBars=Bars;
}
hope it helps. If you need additional explanations let me know.
oromek
i will tell you how i do this. I use variable Bars that returns number of bars in the current chart. I find it very handy here as it changes it's value everytime with new bar
1. create variable (for example) int currBars
2. use such expression:
if (currBars!=Bars)
{
//insert here anything you want to run only once per each candle, it will be executed at the begging of each candle, at the first tick
currBars=Bars;
}
hope it helps. If you need additional explanations let me know.
oromek
Thank you for your help
Mike

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
can you help me to have only trade once per candle? It would really be appreciated.
Thank you in advance for your reply and help, any help is greatly apriciated.
Mike