OPEN-SOURCE SCRIPT
BB-RSI - Short Indicator

BB-RSI — Short Indicator
🔷 What it does:
This is a signal-only indicator that mirrors a fade-the-strength short DCA workflow. It tracks one virtual short position at a time, opened only when TWO independent overbought conditions align on a lower timeframe, then scales the position with up to nine safety orders as price ladders higher against entry. The indicator computes a running average entry, total deployed capital, and open PnL from the live fill ledger and renders all of it on the chart. Every event emits a webhook-ready JSON payload tailored for a DCA Bot.
- Dual confirmation entry: Bollinger Bands %B(20, 2.0) crossing up 1.00 AND RSI(7) crossing up 65, both on 30m.
- Wide deviation ladder: 0.72% to first safety order, 1.55× step multiplier — last AO at ~63% above base entry.
- Soft compounding: each safety order is sized 1.03× the previous one.
- Fixed exit: TP at 2.11% below the running average entry. No trailing, no Stop Loss.
- Eleven discrete events per cycle (entry + 9 AO fills + TP) — each one fires its own webhook payload.
🔷 Who is it for:
- Swing traders running a DCA Bot on crypto perpetuals that frequently overshoot resistance.
- Bot operators who want a chart-driven signal source that emits per-event JSON ready for a DCA Bot.
- Traders who want to monitor an evolving short position — base entry, owned AO levels, deployed capital, open PnL — directly on the chart without the strategy-tester overhead.
- Risk-conscious operators building a high-confidence, low-drawdown defensive short into a diversified portfolio.
🔷 How does it work:
Bollinger Bands %B Filter: A 30-minute Bollinger Bands(20, 2.0) is sampled via request.security and converted to %B = (close − lower) / (upper − lower). The BB gate fires when %B crosses up the configured level (default 1.00 — price exiting the upper band) at host-bar close.
RSI Filter: A 30-minute RSI(7) is sampled in parallel. The RSI gate fires when RSI crosses up the configured level (default 65 — entering overbought) at host-bar close.
Entry: When both gates align at the same host-bar close, the indicator marks a virtual short entry, captures the base entry price, seeds the cost-basis ledger, and fires the entry webhook payload.
Safety Order Ladder: After base entry, the indicator monitors close price upward against the position. When close reaches base entry × (1 + cumulative deviation), the k-th safety order is marked filled, cost-basis is updated, and the AO webhook payload is fired. Cumulative deviation grows by the step multiplier (default 1.55): 0.72%, 1.84%, 3.57%, 6.25%, 10.40%, 16.48%, 25.90%, 40.51%, 63.14%. AO USDT size grows by 1.03× per fill — soft compounding rather than aggressive martingale.
Honest Virtual Bookkeeping: Total cost and total qty are updated incrementally on every event, so the avg entry, deployed capital, and open PnL displayed in the status table reflect the actual broker-equivalent position state — no shortcut from base entry, no synthetic averaging.
Exit: A fixed Take Profit at 2.11% below the running average entry. When close reaches the TP target, the close webhook payload fires and the virtual position resets.
🔷 Why it's unique:
- Dual-Filter Confirmation: Two independent signals on the same lower timeframe must align. %B captures volatility expansion beyond statistical bounds; RSI captures momentum overheating. Together they filter out the either-or noise that triggers single-condition strategies.
- Soft Compounding Ladder: The 1.03× size multiplier is much gentler than typical martingale (1.5–2.0×). It scales position size with adverse drift but doesn't blow up capital deployment if all safety orders fill.
- Fill-by-Fill Avg Entry: The orange avg-entry line is derived from running totals updated on every event — what you see is what the broker-equivalent position would actually have.
- Per-Event Webhook Ledger: Eleven distinct events per cycle, each with its own JSON alert payload. The indicator drives a DCA Bot end-to-end through a single TradingView alert.
🔷 Considerations Before Using the Indicator:
Market & Timeframe: Designed for liquid crypto perpetuals on 30m–1h ranges. Default thresholds are calibrated for ATOMUSDT.P 30m. Strongly trending markets will fill the entire 9-AO ladder and hold the short while price grinds higher — the dual filter limits exposure to confirmed overbought conditions, but a regime shift to a strong trend requires manual oversight.
Cross Detection Granularity: Entries and AO fills are evaluated on bar close. A bar that spikes through a level and returns within the same bar may be missed by design — this matches realistic polling behavior and avoids over-signaling on intra-bar wicks.
Live vs Historical State: The virtual position state is rebuilt from chart history each time the indicator is recompiled. If the indicator is added mid-deployment or the live bot diverges from the signal stream (manual interventions, partial fills), the indicator state may not match the live bot. Toggle the indicator off and on to reset.
Funding Rates (Perpetuals): The indicator does not account for perpetual funding rates. Sustained positive funding (longs pay shorts) improves live performance; sustained negative funding degrades it. Review the historical funding pattern before live deployment.
No Stop Loss: There is no exit signal on adverse moves beyond the 9-AO ladder. Risk is structurally capped on the bot side by the bounded position-size ladder. If a hard exchange-side stop is required, configure it on the bot directly.
Backtesting Note: This is an indicator, not a strategy. There is no built-in P&L tester. For performance metrics over a 2.5-year sample (~267 closed trades, 79.78% win rate, 1.53% max drawdown, profit factor 6.23), use the companion strategy version on identical parameters.
🔷 How to Use It:
🔸 Add the indicator to a 30m chart on the perpetual pair you want to trade.
🔸 Review the BB filter (timeframe / period / deviation / level) and the RSI filter (timeframe / length / level). Defaults are calibrated for ATOMUSDT.P 30m — recalibrate per asset before deploying.
🔸 Set the AO ladder parameters (count, first AO size, step, multipliers) and the Take Profit percentage to match your bot's configuration.
🔸 In the DCA Bot Webhook group, paste the Bot ID, Email Token, and Pair (QUOTE_BASE format, e.g., USDT_ATOM).
🔸 Create an alert on the indicator with "Any alert() function call". Paste the DCA Bot's webhook URL into the alert's Webhook field. The indicator will emit JSON payloads for short entry, each safety order, and TP exit — formatted for direct DCA Bot consumption.
🔷 INDICATOR SETTINGS
Base Order Size (USDT): Virtual order size for the avg-entry computation. Real sizing happens on the bot.
First AO Size (USDT): Virtual size of the first safety order; subsequent AOs scale by the Size Multiplier.
Order Size Multiplier: Factor that grows each subsequent safety order's USDT size.
Averaging Orders per Trade: Maximum number of safety orders per deal (default 9).
Deviation to First AO (%): Distance from base entry at which AO1 becomes eligible.
Deviation Step Multiplier: Ladder factor that widens each subsequent deviation step.
BB Timeframe / Period / Deviation / Level: Lower-timeframe Bollinger Bands %B filter on the host symbol.
RSI Timeframe / Length / Level: Lower-timeframe RSI filter on the host symbol.
Take Profit (%): Fixed distance below the running average entry where the virtual short closes.
DCA Bot Webhook: Bot ID, Email Token, and Pair fields injected into every alert payload.
Visualization: Toggle DCA Ladder, Avg Entry / TP plot lines, fill labels, signal triangles, status table.
Brand Watermark: Configurable text, position, size, and transparency.
👨🏻💻💭 We hope this tool helps enhance your trading. Your feedback is invaluable, so feel free to share any suggestions for improvements or new features you'd like to see implemented.
__
The information and publications within the 3Commas TradingView account are not meant to be and do not constitute financial, investment, trading, or other types of advice or recommendations supplied or endorsed by 3Commas and any of the parties acting on behalf of 3Commas, including its employees, contractors, ambassadors, etc.
🔷 What it does:
This is a signal-only indicator that mirrors a fade-the-strength short DCA workflow. It tracks one virtual short position at a time, opened only when TWO independent overbought conditions align on a lower timeframe, then scales the position with up to nine safety orders as price ladders higher against entry. The indicator computes a running average entry, total deployed capital, and open PnL from the live fill ledger and renders all of it on the chart. Every event emits a webhook-ready JSON payload tailored for a DCA Bot.
- Dual confirmation entry: Bollinger Bands %B(20, 2.0) crossing up 1.00 AND RSI(7) crossing up 65, both on 30m.
- Wide deviation ladder: 0.72% to first safety order, 1.55× step multiplier — last AO at ~63% above base entry.
- Soft compounding: each safety order is sized 1.03× the previous one.
- Fixed exit: TP at 2.11% below the running average entry. No trailing, no Stop Loss.
- Eleven discrete events per cycle (entry + 9 AO fills + TP) — each one fires its own webhook payload.
🔷 Who is it for:
- Swing traders running a DCA Bot on crypto perpetuals that frequently overshoot resistance.
- Bot operators who want a chart-driven signal source that emits per-event JSON ready for a DCA Bot.
- Traders who want to monitor an evolving short position — base entry, owned AO levels, deployed capital, open PnL — directly on the chart without the strategy-tester overhead.
- Risk-conscious operators building a high-confidence, low-drawdown defensive short into a diversified portfolio.
🔷 How does it work:
Bollinger Bands %B Filter: A 30-minute Bollinger Bands(20, 2.0) is sampled via request.security and converted to %B = (close − lower) / (upper − lower). The BB gate fires when %B crosses up the configured level (default 1.00 — price exiting the upper band) at host-bar close.
RSI Filter: A 30-minute RSI(7) is sampled in parallel. The RSI gate fires when RSI crosses up the configured level (default 65 — entering overbought) at host-bar close.
Entry: When both gates align at the same host-bar close, the indicator marks a virtual short entry, captures the base entry price, seeds the cost-basis ledger, and fires the entry webhook payload.
Safety Order Ladder: After base entry, the indicator monitors close price upward against the position. When close reaches base entry × (1 + cumulative deviation), the k-th safety order is marked filled, cost-basis is updated, and the AO webhook payload is fired. Cumulative deviation grows by the step multiplier (default 1.55): 0.72%, 1.84%, 3.57%, 6.25%, 10.40%, 16.48%, 25.90%, 40.51%, 63.14%. AO USDT size grows by 1.03× per fill — soft compounding rather than aggressive martingale.
Honest Virtual Bookkeeping: Total cost and total qty are updated incrementally on every event, so the avg entry, deployed capital, and open PnL displayed in the status table reflect the actual broker-equivalent position state — no shortcut from base entry, no synthetic averaging.
Exit: A fixed Take Profit at 2.11% below the running average entry. When close reaches the TP target, the close webhook payload fires and the virtual position resets.
🔷 Why it's unique:
- Dual-Filter Confirmation: Two independent signals on the same lower timeframe must align. %B captures volatility expansion beyond statistical bounds; RSI captures momentum overheating. Together they filter out the either-or noise that triggers single-condition strategies.
- Soft Compounding Ladder: The 1.03× size multiplier is much gentler than typical martingale (1.5–2.0×). It scales position size with adverse drift but doesn't blow up capital deployment if all safety orders fill.
- Fill-by-Fill Avg Entry: The orange avg-entry line is derived from running totals updated on every event — what you see is what the broker-equivalent position would actually have.
- Per-Event Webhook Ledger: Eleven distinct events per cycle, each with its own JSON alert payload. The indicator drives a DCA Bot end-to-end through a single TradingView alert.
🔷 Considerations Before Using the Indicator:
Market & Timeframe: Designed for liquid crypto perpetuals on 30m–1h ranges. Default thresholds are calibrated for ATOMUSDT.P 30m. Strongly trending markets will fill the entire 9-AO ladder and hold the short while price grinds higher — the dual filter limits exposure to confirmed overbought conditions, but a regime shift to a strong trend requires manual oversight.
Cross Detection Granularity: Entries and AO fills are evaluated on bar close. A bar that spikes through a level and returns within the same bar may be missed by design — this matches realistic polling behavior and avoids over-signaling on intra-bar wicks.
Live vs Historical State: The virtual position state is rebuilt from chart history each time the indicator is recompiled. If the indicator is added mid-deployment or the live bot diverges from the signal stream (manual interventions, partial fills), the indicator state may not match the live bot. Toggle the indicator off and on to reset.
Funding Rates (Perpetuals): The indicator does not account for perpetual funding rates. Sustained positive funding (longs pay shorts) improves live performance; sustained negative funding degrades it. Review the historical funding pattern before live deployment.
No Stop Loss: There is no exit signal on adverse moves beyond the 9-AO ladder. Risk is structurally capped on the bot side by the bounded position-size ladder. If a hard exchange-side stop is required, configure it on the bot directly.
Backtesting Note: This is an indicator, not a strategy. There is no built-in P&L tester. For performance metrics over a 2.5-year sample (~267 closed trades, 79.78% win rate, 1.53% max drawdown, profit factor 6.23), use the companion strategy version on identical parameters.
🔷 How to Use It:
🔸 Add the indicator to a 30m chart on the perpetual pair you want to trade.
🔸 Review the BB filter (timeframe / period / deviation / level) and the RSI filter (timeframe / length / level). Defaults are calibrated for ATOMUSDT.P 30m — recalibrate per asset before deploying.
🔸 Set the AO ladder parameters (count, first AO size, step, multipliers) and the Take Profit percentage to match your bot's configuration.
🔸 In the DCA Bot Webhook group, paste the Bot ID, Email Token, and Pair (QUOTE_BASE format, e.g., USDT_ATOM).
🔸 Create an alert on the indicator with "Any alert() function call". Paste the DCA Bot's webhook URL into the alert's Webhook field. The indicator will emit JSON payloads for short entry, each safety order, and TP exit — formatted for direct DCA Bot consumption.
🔷 INDICATOR SETTINGS
Base Order Size (USDT): Virtual order size for the avg-entry computation. Real sizing happens on the bot.
First AO Size (USDT): Virtual size of the first safety order; subsequent AOs scale by the Size Multiplier.
Order Size Multiplier: Factor that grows each subsequent safety order's USDT size.
Averaging Orders per Trade: Maximum number of safety orders per deal (default 9).
Deviation to First AO (%): Distance from base entry at which AO1 becomes eligible.
Deviation Step Multiplier: Ladder factor that widens each subsequent deviation step.
BB Timeframe / Period / Deviation / Level: Lower-timeframe Bollinger Bands %B filter on the host symbol.
RSI Timeframe / Length / Level: Lower-timeframe RSI filter on the host symbol.
Take Profit (%): Fixed distance below the running average entry where the virtual short closes.
DCA Bot Webhook: Bot ID, Email Token, and Pair fields injected into every alert payload.
Visualization: Toggle DCA Ladder, Avg Entry / TP plot lines, fill labels, signal triangles, status table.
Brand Watermark: Configurable text, position, size, and transparency.
👨🏻💻💭 We hope this tool helps enhance your trading. Your feedback is invaluable, so feel free to share any suggestions for improvements or new features you'd like to see implemented.
__
The information and publications within the 3Commas TradingView account are not meant to be and do not constitute financial, investment, trading, or other types of advice or recommendations supplied or endorsed by 3Commas and any of the parties acting on behalf of 3Commas, including its employees, contractors, ambassadors, etc.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
📈 Stop guessing your settings — backtest & optimize with QuantPilot
🎁 Free to start
🎁 Free to start
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
📈 Stop guessing your settings — backtest & optimize with QuantPilot
🎁 Free to start
🎁 Free to start
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.