2024-09-05 11:27:46 +00:00
# Daily Reversal
2024-09-05 11:33:10 +00:00
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.
2024-09-05 11:38:10 +00:00
## 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.
2024-09-05 11:59:43 +00:00
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.
2024-09-05 11:45:04 +00:00
## Parameters
**Position Size**: A fixed dollar amount to use when sizing each position in order to account for lower historical index values. (Default: 10000)
2024-09-05 12:05:38 +00:00
## 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 )
2024-09-05 11:27:46 +00:00
---