BurtonM
New member
RSI Strategy for TradingView - Pine Script
This trading Strategy comes from a video by Ali Casey at StatOasis on YouTube,Thank you Ali for sharing all your data analysis, and backtesting.
RSI Trading Strategy That PRINTS Money

It is important you watch the video link above to understand this RSI Strategy.
IMPORTANT: This Strategy developed and backtested on the S&P500 Daily timeframe.
I have coded 4 versions: MT4 version is here. MT5 version is here. Python version is here.
A txt file is attached below this post for easy downloading.
TradingView version:
Structure:
- Uses Pine Script v5 syntax
- Strategy settings are defined at the top with input parameters
- Includes visual elements like plots and shapes for better visualization
Features Added:
- Visual plotting of entry/exit points
- Information table showing current values
- Alert conditions for entries and exits
- Position tracking with bars held counter
Trading Logic:
- Core strategy (RSI-based entries and exits)
- Same entry/exit conditions
- Position management with maximum bars held
- Stop loss implementation using strategy.exit
To use this in TradingView:
- Open TradingView Pine Editor
- Paste the code
- Click "Save" and give it a name
- Click "Add to Chart"
- Configure inputs in the Strategy Tester panel
- Use Strategy Tester to backtest
- Lot Size for position sizing
- Stop Loss distance
- RSI parameters (period, entry/exit levels)
- Maximum bars to hold a position
The strategy will show:
- Green triangles for entry points
- Red triangles for exit points
- Information table with current values
- Optional alerts for entries and exits
Attachments
Last edited: