(Exponential) moving average gaps as entries

Avatar
  • updated

Hi. 

My idea is to implement the possibility of going long at the close of user-specified Nth candle not touching (i.e. the high of the Nth candle is lower than) user-specified EMA of the same candle, and going short at the close of user-specified Nth candle not touching (i.e. the low of the Nth candle is higher than) user-specified EMA of the same candle. 


To make it clearer:


Image 4362

Image 4363

In these cases, if I put N = 1, then the EA enters the trade as soon as one candle does not touch the EMA from above or from below. (In the second picture, the EA would also open another order, because there's another candle not touching the EMA).