I am using an EA which closes trades based on the above logic, but it often results in premature closure of trades when the fast MA reverses signal.
I would like to adapt the closeOrderBuy() trigger to be based only when the fast MA crosses the slow MA in a downtrend and vice versa for closeOrderSell(). This requires the actual trendline values rather than the trend direction. However, I think that the handleHull and slowHandleHull will result in trend directions, not trendline values.
Would it be possible to improve the attached Indicator or above logic to also obtain the trendline value of each candle? I struggle with this step.
There are two questions:
- Do you create an indicator handle ONCE (in OnInit)?
- Are you using 'ArraySetAsSeries' for 'hullVal' and 'slowHullVal' arrays?
Hello!
I was able to interpret the hullVal and slowHullVal and determine that hullVal[2] and slowHullVal[2] represent the trendline values, and make the required logic adjustments.
Thank you for your response :)
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I am using an EA which closes trades based on the above logic, but it often results in premature closure of trades when the fast MA reverses signal.
I would like to adapt the closeOrderBuy() trigger to be based only when the fast MA crosses the slow MA in a downtrend and vice versa for closeOrderSell(). This requires the actual trendline values rather than the trend direction. However, I think that the handleHull and slowHandleHull will result in trend directions, not trendline values.
Would it be possible to improve the attached Indicator or above logic to also obtain the trendline value of each candle? I struggle with this step.