ninjatrader/strategies/%b/README.md

61 lines
2.3 KiB
Markdown
Raw Normal View History

2024-09-26 12:49:07 +00:00
# %B
This strategy was taken from chapter 5 of [*High Probability ETF Trading*](https://moshferatu.dev/moshferatu/high-probability-etf-trading) (2009) by Larry Connors.
It is based on the [%B indicator](https://moshferatu.dev/moshferatu/ninjatrader/src/branch/main/indicators/%25b).
2024-09-26 13:07:57 +00:00
## Rules
**Long**
1. The ETF (e.g., SPY) must be above its 200-day moving average.
2. If the %B closes < 0.2 for 3 days in a row, enter a long trade.
3. **(Optional Aggressive Version)** If the %B closes < 0.2 again during the initial trade, enter a second long trade.
4. Exit the trade when the %B closes > 0.8.
**Short**
1. The ETF (e.g., SPY) must be below its 200-day moving average.
2. If the %B closes > 0.8 for 3 days in a row, enter a short trade.
3. **(Optional Aggressive Version)** If the %B closes > 0.8 again during the initial trade, enter a second short trade.
4. Exit the trade when the %B closes < 0.2.
## Parameters
**Long-Term Trend Period**: The period of the long-term trend as measured by a simple moving average. (Default: 200)
**%B Period**: The period to use in the %B calculation. (Default: 5)
**%B Standard Deviations**: The standard deviation to use in the %B calculation. (Default: 1.0)
**Consecutive Days**: The number of days in a row that the %B must be above / below the threshold in order to trade. (Default: 3)
**Enable Long Trades**: Whether to enable taking long trades. (Default: true)
**Long %B Entry**: The %B threshold under which to enter a long trade. (Default: 0.2)
**Long %B Exit**: The %B threshold above which to exit a long trade. (Default: 0.8)
**Enable Short Trades**: Whether to enable taking short trades. (Default: true)
**Short %B Entry**: The %B threshold above which to enter a short trade. (Default: 0.8)
**Short %B Exit**: The %B threshold below which to exit a short trade. (Default: 0.2)
**Enable Aggressive Entries**: Whether to enable taking aggressive second entries when conditions are met. (Default: true)
## Backtest Results
### SPY
![SPY Analysis](https://static.moshington.com/images/strategies/%25b/spy-analysis.png)
![SPY Summary](https://static.moshington.com/images/strategies/%25b/spy-summary.png)
### QQQ
![QQQ Analysis](https://static.moshington.com/images/strategies/%25b/qqq-analysis.png)
![QQQ Summary](https://static.moshington.com/images/strategies/%25b/qqq-summary.png)
2024-09-26 12:49:07 +00:00
---