I'm new to ninjatrader and attempting to build a divergence trading strategy, although I need to some help in what code to use.
The strategy will buy/short if all these criteria are met:
1) Upward/Downward trend in price (which is decided by the two most recent peaks/dips in the price) and an opposite trend in the RSI
2) The RSI is at overbought or oversold levels (RSI>70 for overbought or RSI<30 for oversold)
3) Swing Trade indicated (there are two candle sticks in the opposite direction of the price's trend)
For example: if price was trending upwards with the two most recent peaks being new highs, whilst RSI was trending downwards with the 2nd latest peak being a high and then the latest peak being a lower high, and both of the RSI's peaks must of been above 70 (indicating the stock is overbought). This would indicate a possible price reversal but before shorting, the code needs to see a swing trade, so two red candlesticks. At which point the code will then short the stock. And vice-versa for buying the stock.
Any help would be greatly appreciated, and thank you for taking the time to read my post
Kind regards,
Stephen
Comment