ninjatrader/strategies/trin/README.md

46 lines
1.7 KiB
Markdown

# TRIN
This strategy was taken from chapter 12 of [*Short Term Trading Strategies That Work*](https://moshferatu.dev/moshferatu/short-term-trading-strategies-that-work) (2008) by Larry Connors.
It is based on the short-term trading index (TRIN), also known as the Arms index.
The formula for calculating the TRIN of an index is as follows:
```
TRIN = (Advancing Stocks / Declining Stocks) / (Advancing Volume / Declining Volume)
```
Typically, a TRIN reading below 1 corresponds to rising prices whereas a reading above 1 corresponds to declining prices.
## Rules
1. The asset (e.g., SPY) is above its 200-day moving average.
2. The 2-period RSI is below 50.
3. If TRIN closes above 1 for 3 consecutive days, enter a long trade.
4. Exit the trade when the 2-period RSI is above 65.
## Parameters
**Long-Term Trend Period**: The period of the long-term trend as measured using a simple moving average. (Default: 200)
**RSI Period**: The period used in the RSI calculation. (Default: 2)
**RSI Smoothing**: The smoothing used in the RSI calculation. (Default: 1, no smoothing)
**RSI Entry Threshold**: The RSI value below which trades are allowed to be entered. (Default: 50)
**RSI Exit Threshold**: The RSI value above which trades are exited. (Default: 65)
**TRIN Entry Threshold**: The TRIN value above which trades are allowed to be entered. (Default: 1.0)
**Days Above Threshold**: The number of days in a row that the TRIN must be above the entry threshold in order to enter a trade. (Default: 3)
## Backtest Results
### SPY
![SPY Analysis](https://static.moshington.com/images/strategies/trin/spy-analysis.png)
![SPY Summary](https://static.moshington.com/images/strategies/trin/spy-summary.png)
---