How to control a number of order placement?
If you need to open one order for each new candle you need a function to check if the new incoming tick generate a new candle or not.
// Global variables datetime lastBar = 0; // OnTick bool IsNewBar = iTime(NULL,0,0) > lastBar; if( IsNewBar ) { lastBar = iTime(NULL,0,0); // Code for each new bar }
Thank you Fabio. I will try with it.
Best regards,
MyGreen

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
I am building a simple EA to place an order based on MA. (i.e. when a bid price is above MA then to place a buy order....). I want to place only one order placement for each candle. Do you know how to control for this?
Best,
Mygreen