ninjatrader/strategies/daily-reversal/README.md

49 lines
1.7 KiB
Markdown

# Daily Reversal
This strategy was inspired by a [post on r/algotrading](https://www.reddit.com/r/algotrading/comments/1f8v70e/backtest_results_for_a_simple_reversal_strategy/) by u/Russ_CW.
## Rules
1. The previous day must have a lower low and lower high than the day before that.
2. 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.
3. 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.
### SPX
![SPX Analysis](./backtest-results/spx_analysis.png)
![SPX Summary](./backtest-results/spx_summary.png)
### SPY
![SPY Analysis](./backtest-results/spy_analysis.png)
![SPY Summary](./backtest-results/spy_summary.png)
### QQQ
![QQQ Analysis](./backtest-results/qqq_analysis.png)
![QQQ Summary](./backtest-results/qqq_summary.png)
---