Of course. Assuming that there only should be not more than1 open position check if there is a buy signal whether there is one open buy position (do nothing) and if there is a sell position or no open position open a buy position (and close the sell position).
-
Check for an open order before opening. Or,
-
Act on a change of signal.
MQL4 (in Strategy Tester) - double testing of entry conditions - MQL4 programming forum #1 (2017)
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 wanted t know if someone can help me out all my script is done but when i put on backtesting the EA open more than one trade when the conditions are good
My conditions are if CCI > 100 and when the candles of the chart are over the moving average it's a buy signal
But when the buy signal is given the EA opens plenty of trades can somebody help me out?
I try that when the conditions are good that the EA only open one trade per buy signal
My code is below
Thank you,