I have an EA, the trade opening condition is as follows, after market move away from the first trade by 10 pips the EA should take the second trade, if market move away from the second trade by 10 pips third trade should be opened, etc. The EA is doing exactly according to the condition only when the forex market is not moving very fast. Problem comes in when the market is moving very fast, the EA usually open too many trades that are no longer according to the condition. I will be glad to get a working solution to this problem. Thank you in advance.
- ..@@ need help in opening orders codes and in selectorder codes @@..
- Envelope 2.11
- [Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2.
ArchRaphael:
I have an EA, the trade opening condition is as follows, after market move away from the first trade by 10 pips the EA should take the second trade, if market move away from the second trade by 10 pips third trade should be opened, etc. The EA is doing exactly according to the condition only when the forex market is not moving very fast. Problem comes in when the market is moving very fast, the EA usually open too many trades that are no longer according to the condition. I will be glad to get a working solution to this problem. Thank you in advance.
Show the code and what do you mean by " that are no longer according to the condition"?
Keith Watford:
The opening condition is Show the code and what do you mean by " that are no longer according to the condition"?
If(count.buy()== 0)
Open buy();
That is the condition that keeps open buy trade after taking the first buy trade. It is obvious count.buy() is no longer 0 after the first buy trade.
Please edit your post and use the code button (Alt+S) when pasting code.
EDIT your original post, please do not just post the code correctly in a new post.
ArchRaphael:
The opening condition is
The opening condition is
If(count.buy()== 0)
Open buy();
That is the condition that keeps open buy trade after taking the first buy trade. It is obvious count.buy() is no longer 0 after the first buy trade.
Nothing is obvious with the snippet of code that you have posted.
Anyway, as it is your intention is to open a grid, it makes no sense to limit it to a single trade.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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