So I am trying to figure how to check if the trend reversal is happening and WMA will act as support level. The formula I am trying to write is
BUY: if (current candle is green and current candle is opening above WMA and previous 3 candles have closed below WMA)
AND
SELL: if (current candle is red and current candle opened below WMA and previous 3 candles have closed above WMA)
Questions:
- Noob at algo trading so not sure if this formula works or not, it is something i came up with.
- Is there a shortcut to know what happened with last N candles instead of writing Close(-1), Close(-2) offset syntax
- Is there a better way to express this? In terms of technical indicator that already encapsulate this information?
The formula I wrote:
PS: couldn’t write for all 3 candles because limited by 5 conditions.