Tradehook — Trading Automation Service
mediumTechnical Indicator

RSGAlgo

The RSG Algorithm identifies and trades within established price ranges by detecting support and resistance zones and executing mean-reversion trades when price approaches these levels. The system includes optional grid-based scaling for position building.

TradingView Preview
See this algorithm in action on real charts
RSGAlgo TradingView chart
Performance Metrics
Historical backtesting results
83.3%
Win Rate
5.33
Profit Factor
7.1%
Max Drawdown
$3226
Avg Trade
Based on 30 trades

About This Algorithm

RANGE SUPPORT GRID STRATEGY

Quick Facts:

  • Category: Range Trading / Support-Resistance
  • Markets: Range-bound markets
  • Timeframes: 15min, 1H, 4H

Overview

The RSG Algorithm identifies and trades within established price ranges by detecting support and resistance zones and executing mean-reversion trades when price approaches these levels. The system includes optional grid-based scaling for position building.

The algorithm excels in ranging markets where price oscillates between defined boundaries, capturing profits from predictable reversals.


How It Works

RANGE DETECTION Identify range boundaries:

  • Range High: Highest high over lookback period
    • Range Low: Lowest low over lookback period
    • Range validation: Price must respect boundaries N times
    • Range width filter: Minimum/maximum width as ATR ratio

SUPPORT/RESISTANCE ZONES Create zones around boundaries (not exact levels):

  • Resistance Zone: Range High ± (ATR × zonePadding)
    • Support Zone: Range Low ± (ATR × zonePadding)
    • Zone approach triggers trade evaluation

ENTRY LOGIC Trade reversals at zone boundaries:

  • Long: Price enters support zone + reversal confirmation
    • Short: Price enters resistance zone + reversal confirmation
    • Confirmation: Pin bar, engulfing, or simple close reversal

GRID SCALING (Optional) Build position as price moves deeper into zone:

  • Initial entry at zone boundary
    • Additional entries at grid intervals
    • Average entry price improves with scaling

Key Parameters

RANGE DETECTION:

  • rangeLookback (50): Period for range detection
    • minRangeTouches (2): Minimum boundary tests for valid range
    • minRangeATR (3.0): Minimum range width as ATR ratio
    • maxRangeATR (10.0): Maximum range width as ATR ratio

ZONES:

  • zonePadding (0.2): Zone width as ATR ratio
    • entryConfirmation ("Reversal"): "Touch" or "Reversal"

GRID (Optional):

  • useGrid (false): Enable grid scaling
    • gridLevels (3): Number of grid entry levels
    • gridSpacing (0.5): ATR spacing between grid levels

Best Use Cases

✅ RANGE-BOUND MARKETS with defined boundaries ✅ CONSOLIDATION TRADING before breakouts ✅ MEAN REVERSION between support/resistance ✅ GRID TRADING for position averaging

Customer Reviews

No reviews yet. Be the first to review this algorithm!
Technical Indicator
Requires Technical Indicator Plan

Subscribe to Technical Indicator or higher to access

Subscription Access

Get access to this indicator/strategy on TradingView through our invite-only system. Your TradingView account will be granted access.

One-Time Purchase

Own the complete Pine Script source code forever. Modify, customize, and use it on your own TradingView account.

$1,500
Subscribe to any tier to unlock one-time purchases

What you get with source code:

  • Complete Pine Script v5 source code
  • Lifetime ownership - no recurring fees
  • Full customization rights
  • Use on your own TradingView account
PlatformTradingView
Subscription AccessTradingView Invite
One-Time PurchaseSource Code
LicensePersonal Use

We Value Your Privacy

We use cookies to enhance your browsing experience, analyze site traffic, and personalize content. By clicking "Accept All", you consent to our use of cookies. Read our Privacy Policy for more information.