Hi , i am wrestling with me ea to open a new position after it sets the initial one at be - page 2
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
solution:
when one position is opened, PositionsTotal() = 0 (just so you know)basically made a typo here, I don't mean to confuse...I meant when no positions are opened PositionsTotal is zero, so using this in a condition enables you to make a rule such that the next logic will be processed only if there are no positions already open (or X number of positions already open)
basically made a typo here, I don't mean to confuse...I meant when no positions are opened PositionsTotal is zero, so using this in a condition enables you to make a rule such that the next logic will be processed only if there are no positions already open (or X number of positions already open)
As a mere side note, I would add that a timer or Sleep instance may be needed following a sent order... especially if your machine is running MT5 faster than MT5 can communicate with the trade server. Otherwise, multiple orders can be sent as MT5 awaits an update of PositionsTotal.