MA cross with shifted lines, modifying ordersend
I've written an EA based on an alligator strategy that uses shifted lines (8,13,21). The OrderSend function opens and closes on the 1st bar after the cross of the actual lines. Is there a way to modify this so that it orders on the bar that the shift is based on? For example, the pink box is where it is currently ordering a trade, but the blue box is where the order should be because I'm using an MA shifted 8. I've tried changing the shift to -8 but that doesn't work for my strategy. I'm drawing a blank on how to accomplish this, help would be appreciated.
- Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes
- How to get MA values that are shifted forward???
- EA based on direction change of moving average