1.7 KiB
1.7 KiB
Daily Reversal
This strategy was inspired by a post on r/algotrading by u/Russ_CW.
Rules
- The previous day must have a lower low and lower high than the day before that.
- Enter a long position on the current day using a limit order placed at the high of the previous day.
- If the current day gaps up and opens above the previous day's high, enter a long at the open.
- Exit the position at the end of the day.
NinjaScript is unable to initiate or exit trades at the close of a bar.
It is also not possible to know in advance (at the close of the day) whether the following day will open above the previous high.
Therefore, this strategy incorporates a 1-minute data series in the following manner:
- Instead of exiting any open position at the end of the day, it is closed at the open of the final minute.
- If a long position is to be entered at the open due to a gap up, it is instead entered after one minute has elapsed.
Parameters
Position Size: A fixed dollar amount to use when sizing each position in order to account for lower historical index values. (Default: 10000)
Backtest Results
The backtest shared in the Reddit thread goes back to the beginning of 2000.
However, my data provider only has 1-minute data going back to 2007.