Any help would be appreciated.
Am I deleting the pending orders correctly should I start looking there?
![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
Hi,
I'm a complete beginner so apologies in advance. I have created an EA based on a consolidation breakout indicator. Once the conditions are met it sends two pending orders at the high and low of the consolidation. Once one order is entered the other should be cancelled and a trailing stop tracks the trend.
I wanted the stop loss to updated once per bar (see my hashed attempt below NewBar()) but this was sending a whole load of OrderModify() errors.
Even once I removed the (NewBar()) function. In back testing it only completes one trade at the beginning and doesn't enter another trade (even thou there are multiple entry conditions).
As a beginner I have exhausted all my efforts, I'm sure I'm missing something pretty basic but just can't see it.
Can someone point my in the right direction as to what I've missed.
Also on another note if anyone has any tips about styling or best practice for MQL4 it would be much appreciated. As I mention I'm new, so any pointer would be amazing even thou this forum and the documentation is excellent I have struggled to find any detailed course on the application and common pitfalls for new comers. I would love any suggestions.