OPEN-SOURCE SCRIPT

ARB RSI Short Indicator [3Commas]

322
ARB RSI Short Indicator [3Commas]

🔷 What it does:
This is the signal-only companion to the ARB RSI Short strategy — it fires alerts without running a backtest engine. It tracks one virtual short at a time, opened when the 4-hour RSI(14) crosses back DOWN through 74 (an overbought rollover). Two averaging orders stack ABOVE entry at +5% and +10% (sizes scaled 1.7×: 850, then 1,445). The deal closes on a fixed 6% Take Profit from the average. There is no Stop Loss — the position is bounded by the 2-rung ladder. Running average entry, deployed capital, open PnL, and lifetime realized PnL are kept from honest fill-by-fill bookkeeping, and every event emits a webhook-ready JSON payload for a DCA Bot.
- Entry on the 4h RSI rollover: crossing DOWN through 74.
- Two averaging orders above entry: +5% / +10%, sized 1.7× per rung.
- Fixed 6% Take Profit from the running average. No trailing.
- No Stop Loss — bounded by the 2-AO ladder.
- Live Open PnL and lifetime Total PnL on the chart.

🔷 Who is it for:
- Swing traders fading higher-timeframe overbought conditions on ARB.
- DCA-style traders comfortable with rare, selective entries (a 4h RSI rollover fires only a few times per year).
- Bot operators wiring TradingView alerts straight into a DCA Bot via per-event JSON.
- Traders who accept a bounded ladder with no hard stop in exchange for a high deal-close rate.

🔷 How does it work:
Entry Trigger: A 4-hour RSI(14) is pulled with request.security and lookahead disabled (no repaint). The short fires when that RSI was ≥ 74 on the prior 4h close and drops below it on the current close.
Base Entry: On the trigger, the indicator marks a virtual short, records the entry, and seeds the cost-basis ledger with the base order size (default 500 USDT).
Averaging Ladder: Two safety orders at fixed +5% / +10% above base, sized 850 then 1,445 (1.7× progression). Each fill updates the running cost-basis and dispatches its own webhook, raising the virtual average entry.
Honest Bookkeeping: Cost and quantity update on every event, so the average entry, deployed capital, Open PnL, and Total PnL in the status table reflect the true broker-equivalent state.
Exit: A fixed 6% Take Profit below the running average. When close reaches it, the close webhook fires, realized PnL accumulates, and the virtual position resets.
No Stop Loss: There is no exit signal above the top rung. Risk is structurally capped on the bot side by the bounded position; if a hard stop is required, configure it on the bot.
Lifetime Total PnL: Each closed cycle's realized PnL accumulates into a lifetime counter shown alongside the current-cycle Open PnL.

🔷 Why it's unique:
- Higher-Timeframe Rollover: Firing on a 4h RSI cross-down through 74 is far more selective than an intraday trigger — it waits for a meaningful overbought turn.
- Bounded Averaging, No Stop: A compact 2-rung 1.7× ladder caps the maximum position in advance, which is the structural risk control in place of a stop.
- Fixed Recovery Target: The 6% Take Profit on the averaged-down entry releases the deal on a clean, defined bounce.
- Lifetime PnL Tracking: Open and lifetime Total PnL on the chart give strategy-tester-equivalent insight without a backtest.
- Plug-and-Play Webhooks: Base, each AO, and the exit each emit a complete JSON alert; one "Any alert() function call" alert drives a DCA Bot end-to-end.

🔷 Considerations Before Using the Indicator:
Sample Size (Important): Over a ~3.25-year backtest the companion strategy produced only 10 closed trades — far below the ~100-trade floor for statistical relevance. The 80% win rate and high profit factor are a consequence of this tiny, selective sample and must NOT be extrapolated. Treat them as a demonstration of the entry's discipline; validate across more assets and conditions, and expect a very low signal frequency.
No Stop Loss / Tail Risk: With no stop, a sustained rally above the +10% top rung leaves the full virtual position open until price reverts to the 6% target — the largest risk here. The bounded ladder caps deployment (~28% of reference equity), not how far price can run against the unhedged remainder.
Short Execution Venue: This signals shorts. Live shorting of ARB requires a margin or perpetual venue — it cannot run on a spot account.
Cross Detection Granularity: Entries, AO fills, and exit evaluate on bar close. A spike-and-revert within a single bar may be missed by design — matching realistic polling and avoiding intra-bar over-signaling.
Live vs Historical State: The virtual state is rebuilt from chart history on each recompile. If added mid-deployment or if the live bot diverges (manual interventions, partial fills), states may differ. Toggle the indicator off and on to reset.
Backtesting Note: This is an indicator, not a strategy. There is no built-in P&L tester — but the live Total PnL counter gives a running approximation. For full metrics over a ~3.25-year sample (10 closed trades, 80.00% win rate, 4.48% max drawdown, profit factor 16.189, +5.30% net return), use the companion strategy version on identical parameters — and read the Sample Size note above before relying on those figures.

🔷 How to Use It:
🔸 Add the indicator to a 4h ARB / USDT chart.
🔸 Review the RSI trigger level (74), the AO deviations/sizes, and the Take Profit. Defaults mirror the source strategy.
🔸 Set Base Order Size and AO sizes to match your bot's configuration (the avg-entry display becomes meaningful when virtual sizing matches real sizing).
🔸 In the DCA Bot Webhook group, paste the Bot ID, Email Token, and Pair (QUOTE_BASE format, e.g., USDT_ARB).
🔸 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 emits JSON for entry, each averaging order, and the TP exit.

🔷 INDICATOR SETTINGS
Base Order Size (USDT): Virtual order size for the avg-entry / open-PnL computation.
Averaging Orders per Trade: Number of safety orders (default 2).
First AO Size (USDT): Virtual size of the first averaging order; subsequent AOs scale by the Order Size Multiplier.
Deviation to First AO (%) / Deviation Step Multiplier: Spacing of the AO ladder above base entry. Defaults to +5% then +10%.
Order Size Multiplier: Per-rung size scaling (default 1.7).
RSI Timeframe / Length / Crossing Down Level: The 4h RSI(14) crossing-down trigger for the base short.
Take Profit (%): Fixed distance below average entry where the virtual short closes.
Active Window: Optional date filter — when ON, the indicator only fires signals between From and To dates.
DCA Bot Webhook: Bot ID, Email Token, and Pair fields injected into every alert payload.
Visualization: Toggle AO Ladder, Avg / 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.

כתב ויתור

המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.