TradingView RSI Strategy - Pine Script

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 đź’° (Tested & Proven)

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:​

  1. 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
  2. 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
  3. 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:​

  1. Open TradingView Pine Editor
  2. Paste the code
  3. Click "Save" and give it a name
  4. Click "Add to Chart"
  5. Configure inputs in the Strategy Tester panel
  6. Use Strategy Tester to backtest
You can customize the strategy by adjusting the input parameters:
  • 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

  • RSI Strategy.txt
    2.5 KB · Views: 2
Last edited:
Back
Top