- Trading Bot - Dynamic RSI (Pro) - Robot Strategy -

The Dynamic RSI (Pro) strategy is an automation-first trading system built on a proprietary RSI Bands calculation that creates dynamic support and resistance levels directly on the price chart. It is designed from the ground up to be operated by a trading bot: every signal, every parameter, and every piece of information needed to place an order is transmitted in real time through TradingView's alert system via invisible plot() outputs embedded in a JSON webhook payload. The bot receives the trade direction, quantity type, leverage, position amount, and stop-loss levels with every alert — enabling fully autonomous order execution without any manual intervention.
Unlike standard RSI strategies that use fixed overbought/oversold levels on a separate oscillator panel, this strategy converts RSI levels into actual price bands — showing exactly at what price level the RSI would reach overbought or oversold conditions. Combined with a WaveTrend oscillator for confirmation and a Stochastic RSI filter for signal validation, this creates a triple-confirmation entry system with adaptive price-based levels. The strategy is optimized for short timeframes (1 to 5 minutes) and uses separate RSI parameters for entries and exits in each direction, providing unprecedented control over signal sensitivity.
The strategy uses LIMIT triggers at predetermined price levels, allowing immediate entry and exit of positions without waiting for the next candle.
BUILT FOR AUTOMATION — JSON WEBHOOK INTEGRATION
A core differentiator of this strategy is its complete automation-readiness. The script does not simply generate buy/sell alerts — it transmits a full set of structured trading parameters on every signal, designed to be consumed by a webhook-based trading bot.
The strategy uses Pine Script's plot() function with display=display.none to create invisible data channels. These plots do not appear on the chart but are accessible via TradingView's {{plot("PlotName")}} placeholder in alert messages. Combined with TradingView's built-in variables ({{ticker}}, {{strategy.order.comment}}, {{interval}}), this enables the construction of a complete JSON payload such as:
What each field transmits:
- comment: The order action — ENTER_LONG, EXIT_LONG, ENTER_SHORT, or EXIT_SHORT — telling the bot exactly what to do.
- ticker: The asset symbol, so a single bot instance can manage multiple assets.
- interval: The chart timeframe, allowing the bot to validate that the signal matches the expected configuration.
- trading_mode: A numeric code indicating the active trading mode.
- qty_type: A numeric code indicating the position sizing method (1=Percent Available, 2=Percent Total, 3=Cash).
- leverage: The configured leverage multiplier, so the bot can place correctly sized orders on the exchange.
- amount_pct: The configured amount (% or $) per entry.
- stop_loss_long_pct / stop_loss_short_pct: The stop-loss percentages for each direction (100 = disabled).
This architecture means the bot does not need to be separately configured with position sizes or risk parameters — everything is defined once in the TradingView strategy settings and automatically transmitted with every alert. Changing a parameter in the strategy immediately updates what the bot receives, ensuring permanent synchronization between backtest settings and live execution.
WHAT MAKES THIS STRATEGY ORIGINAL
- RSI-to-Price-Band conversion (proprietary calculation): The core innovation is a mathematical function that reverse-engineers the RSI formula to compute the exact price levels where the RSI would reach user-defined overbought and oversold thresholds. This produces dynamic support and resistance bands that move with volatility — fundamentally different from static RSI levels or standard Bollinger Bands. The bands adapt to the current rate of change of the asset, providing context-sensitive entry and exit zones.
- Four independent RSI calculations: The strategy uses four separate RSI-to-band calculations, each with its own configurable period: one for long entries (default: 12-period, oversold=31), one for short entries (default: 10-period, overbought=67), one for long exits (default: 30-period, overbought=69), and one for short exits (default: 20-period, oversold=28). This allows the trader to independently optimize entry sensitivity and exit timing for each direction.
- WaveTrend oscillator confirmation: The WaveTrend (based on LazyBear's implementation) adds a secondary momentum confirmation. Long entries require the WaveTrend to be below the oversold level (default: -60), and short entries require it above the overbought level (default: 60). This filters out entries during range-bound conditions.
- Stochastic RSI validation: A Stochastic RSI (%K) with configurable smoothing (default: 3) provides a third confirmation layer. Long signals require the StochRSI to be at or below the oversold level (with tolerance), and short signals require it at or above the overbought level.
- Limit order entries at band levels: Instead of market orders on bar close, the strategy places limit orders at the RSI band price level. This means entries are placed at the mathematically computed support/resistance price rather than at the current market price, typically resulting in better fills.
- Dynamic exit price calculation: Exit orders are also placed as limits at the RSI exit band level. When a take-profit is enabled, the strategy uses the minimum of the TP price and the RSI exit band for longs (or maximum for shorts), ensuring the more conservative exit is always used.
- Cross vs. Touch trigger modes: The user can select between "Cross (close)" mode (candle close must cross the band) or "Touch" mode (candle wick touching the band is sufficient). This allows balancing between signal confirmation and entry speed.
HOW THE STRATEGY WORKS — DETAILED METHODOLOGY
1. RSI Bands Calculation
The core function calculateRsiBands() reverse-engineers the RSI formula to determine the price level at which the RSI would reach a specified value. The calculation:
- Computes the exponential moving averages of upward changes (AUC) and downward changes (ADC) over a period of (2 * length - 1).
- Uses the RSI formula relationships to solve for the price offset needed to reach the target RSI level.
- Returns upper and lower price bands representing the exact prices where RSI would hit the configured overbought and oversold levels.
This produces bands that automatically widen during high volatility and tighten during low volatility — similar to Bollinger Bands but derived from momentum (RSI) rather than pure standard deviation.
2. Entry Signal Generation
For long entries, the strategy checks three conditions simultaneously:
- The close (or low, in Touch mode) has crossed below the RSI lower entry band (the price where RSI would hit the oversold level for the entry RSI length).
- The Stochastic RSI %K is at or below the oversold threshold (with tolerance).
- The WaveTrend oscillator is below the oversold level.
All three conditions must be true on the same bar, and no position must be currently open. The entry is placed as a limit order at the RSI lower band price.
For short entries, the mirror logic applies: close (or high) crossing above the upper band, StochRSI at overbought, WaveTrend at overbought. Entry is a limit order at the upper band price.
3. Exit Signal Generation
For long positions, the exit limit is set at the RSI upper exit band (the price where the exit RSI would hit overbought). If take-profit is enabled, the exit price is the minimum of the TP level and the RSI band — whichever is more conservative. A stop-loss (if enabled) is set as a percentage below the entry price.
For short positions, the exit limit is at the lower exit band or the TP level, whichever is more conservative. Stop-loss is set above the entry price.
4. WaveTrend Oscillator
The WaveTrend is calculated as:
- ap = hlc3 (typical price)
- esa = EMA(ap, primary_length)
- d = EMA(|ap - esa|, primary_length)
- ci = (ap - esa) / (0.015 * d)
- wt1 = EMA(ci, signal_length)
This oscillator measures the deviation of price from its smoothed average, normalized by the average deviation. Values below -60 indicate oversold conditions; above +60 indicate overbought.
5. Stochastic RSI
A standard RSI is calculated on the close price over the internal RSI length (default: 10). The stochastic of this RSI is then computed over a configurable period (default: 10), and the result is smoothed with an SMA of length K (default: 3). The resulting %K is used for threshold-based confirmation.
DEFAULT STRATEGY PROPERTIES
- Initial Capital: $10,000
- Pyramiding: 0 (single position only — the RSI bands logic is not designed for pyramiding)
- Commission: 0.15% per trade
- calc_on_every_tick: false (no repainting)
- Default Mode: Long Only
- Filter Smoothing (StochRSI K): 3
- Long Entry RSI Length: 12 | Oversold Level: 31
- Long Exit RSI Length: 30 | Overbought Level: 69
- Short Entry RSI Length: 10 | Overbought Level: 67
- Short Exit RSI Length: 20 | Oversold Level: 28
- WaveTrend: Primary=10, Signal=10 | OB=60, OS=-60
- Stochastic RSI: Internal RSI=10, Stoch Period=10
- Long Take-Profit: 2.2% (Enabled)
- Short Take-Profit: 1.1% (Enabled)
- Stop-Loss: Disabled by default
- Quantity: 5% of total balance
- Leverage: 2x (for backtesting purposes)
- Trigger Mode: Cross (close)
HOW TO USE THIS STRATEGY
- This strategy is optimized for 1 to 5 minute timeframes. Start with a 1-minute or 5-minute chart on your target asset.
- Select your trading mode: Long Only, Short Only, or Long and Short.
- Adjust the Filter Smoothing (StochRSI K). Values between 2 and 6 work well for 1-minute timeframes. Higher values reduce noise but increase lag.
- Configure the Long entry RSI length and oversold level. Shorter RSI lengths (9-14) produce more reactive bands. The oversold level controls how deep the band sits below price.
- Configure the Long exit RSI length and overbought level. Longer exit RSI lengths (20-34) provide smoother exit bands. The overbought level determines how far price must recover before exiting.
- Repeat for Short parameters (entry overbought and exit oversold).
- Optionally enable take-profit and/or stop-loss for additional risk management. TP is enabled by default (2.2% for longs, 1.1% for shorts).
- The WaveTrend and StochRSI advanced settings can be adjusted for fine-tuning. Default values work well for most 1-5 minute setups.
- Choose between "Cross (close)" and "Touch" trigger modes depending on your preference for confirmation vs. speed.
- Review the RSI bands plotted directly on the chart — they show the dynamic entry and exit price levels in real time.
WHY THIS STRATEGY IS INVITE-ONLY
- The RSI-to-Price-Band conversion is a proprietary calculation that reverse-engineers the RSI formula to produce dynamic support and resistance levels on the price chart. This mathematical approach is fundamentally different from any standard RSI script or Bollinger Band implementation.
- Four independent RSI band calculations with separate parameters for long entry, long exit, short entry, and short exit provide a level of directional control not available in any open-source alternative.
- The triple-confirmation system (RSI Bands + WaveTrend + Stochastic RSI) creates a robust multi-factor signal validation framework.
- Limit order execution at mathematically computed price levels (rather than market orders) provides better theoretical fills and eliminates repainting.
- The Cross/Touch trigger mode gives traders precise control over the sensitivity-confirmation trade-off.
- Full bot-automation readiness with structured alert messages and invisible plot outputs for JSON webhook systems.
- Comprehensive on-chart visualization with entry/exit band overlays, fill zones, and real-time information display.
- The strategy represents original mathematical work converting RSI concepts into price-based dynamic levels — a unique contribution to the TradingView ecosystem.
LIMITATIONS AND IMPORTANT NOTES
- This strategy is optimized for short timeframes (1-5 minutes). Performance characteristics change significantly on higher timeframes and require full parameter re-optimization.
- The RSI bands adapt to volatility but may produce very tight bands during extremely low-volatility periods, leading to frequent and potentially low-quality signals. The WaveTrend and StochRSI filters help mitigate this.
- Limit order entries may not always be filled in fast-moving markets. This is an inherent characteristic of limit-order strategies.
- Past backtest performance does not guarantee future results. Short-timeframe strategies are particularly sensitive to execution quality, slippage, and exchange latency.
- The commission is set to 0.15% by default. Adjust this to match your actual trading costs for accurate backtesting.
- No pyramiding is used — the logic is designed for single-entry, single-exit trades. This limits drawdown but also limits recovery from adverse entries.
- Ensure your automation setup can handle limit order placement and modification at the frequency required by 1-minute timeframes.
- Non-standard chart types (Heikin Ashi, Renko, Kagi, Point and Figure, Range) should not be used for backtesting as they produce unrealistic results.
DISCLAIMER
This script is provided for educational and informational purposes only. It does not constitute financial advice. Trading financial instruments involves substantial risk of loss. Past performance is not indicative of future results. Always conduct your own research and consult with a qualified financial advisor before making any investment decisions. Use this strategy at your own risk.
Script sur invitation seulement
Seuls les utilisateurs approuvés par l'auteur peuvent accéder à ce script. Vous devrez demander et obtenir la permission de l'utiliser. Celle-ci est généralement accordée après paiement. Pour plus de détails, suivez les instructions de l'auteur ci-dessous ou contactez directement Trading-Bot-France.
TradingView ne recommande PAS d'acheter ou d'utiliser un script à moins que vous ne fassiez entièrement confiance à son auteur et que vous compreniez son fonctionnement. Vous pouvez également trouver des alternatives gratuites et open source dans nos scripts communautaires.
Instructions de l'auteur
Clause de non-responsabilité
Script sur invitation seulement
Seuls les utilisateurs approuvés par l'auteur peuvent accéder à ce script. Vous devrez demander et obtenir la permission de l'utiliser. Celle-ci est généralement accordée après paiement. Pour plus de détails, suivez les instructions de l'auteur ci-dessous ou contactez directement Trading-Bot-France.
TradingView ne recommande PAS d'acheter ou d'utiliser un script à moins que vous ne fassiez entièrement confiance à son auteur et que vous compreniez son fonctionnement. Vous pouvez également trouver des alternatives gratuites et open source dans nos scripts communautaires.