OPEN-SOURCE SCRIPT

HBAR RSI Indicator [3Commas]

197
HBAR RSI Indicator [3Commas]

🔷 What it does:
This is a signal-only indicator that mirrors a long-only DCA workflow on HBAR / USDT. It tracks a single virtual position: a base entry opens when 4h RSI(14) drops below 28; if price keeps falling, five averaging orders add to the virtual position at fixed deviations from the base entry, each larger than the last; the position is then closed at a fixed take-profit above the blended average entry. The indicator computes running average entry, deployed capital, open PnL, and lifetime realized PnL from honest fill-by-fill bookkeeping, and emits a webhook-ready JSON alert payload on the base order, every safety order, and the close.
- Single entry filter: 4h RSI(14) below 28 (deep oversold).
- Five averaging orders at fixed deviations (−2%, −5%, −9.5%, −16%, −25%) with 1.8× size scaling per rung.
- Fixed take-profit on the blended average entry; no trailing, no stop loss.
- Honest virtual bookkeeping: avg entry, deployed capital, Open PnL, and cumulative realized PnL displayed live on the chart.

🔷 Who is it for:
- Swing traders accumulating HBAR on deep RSI flushes who want a chart-driven signal source.
- Bot operators who want base / safety-order / close webhook JSON ready to drive a DCA Bot.
- Traders comfortable with martingale-style averaging who size their capital to the worst-case ladder fill.
- Traders who want strategy-tester-equivalent insight (live realized / unrealized PnL) without running a backtest engine.

🔷 How does it work:
Base Entry: On each closed 4h bar the indicator reads RSI(14). When RSI falls below 28 and there is no open virtual position, it marks a virtual base order at the close price and dispatches the entry webhook.
Averaging Orders: Once in a virtual position, the indicator watches price relative to the original base entry. The five safety orders are armed at fixed deviations from that base entry — not cumulatively — at −2%, −5%, −9.5%, −16%, and −25%. As each threshold is crossed on bar close, the corresponding safety order is recorded and its webhook fires. Order sizes scale 1.8× per rung ($900 → $1,620 → $2,916 → $5,249 → $9,448 from a $500 base), pulling the blended average entry down toward the latest fill.
Honest Virtual Bookkeeping: Total cost and 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, no synthetic averaging.
Take Profit & Lifetime PnL: When price closes at or above the take-profit level (a fixed percentage above the average entry), the virtual position is closed, its round-trip profit is added to a persistent realized-PnL counter, and the close webhook fires. The status table displays both Open PnL (current unrealized state) and cumulative realized PnL, so live performance is visible directly on the chart.
Capital Bounds: Total virtual deployed capital cannot exceed the base order plus the five safety orders. Once all five are filled, no further adds occur — the position simply waits for the take-profit.

🔷 Why it's unique:
- Deep-Oversold-Only Entries: A single, strict RSI(14) < 28 filter on 4h keeps the signal quiet in normal conditions and only fires after a meaningful flush.
- Fixed-Deviation Martingale Ladder: Safety orders are placed at fixed percentages from the base entry with deliberate 1.8× size scaling — a transparent, fully-specified averaging schedule rather than an opaque adaptive grid.
- Full Webhook Chain: Base order, each safety order, and the close all emit dedicated JSON payloads. One TradingView alert with "Any alert() function call" drives a 3Commas DCA Bot end-to-end.
- Live PnL Tracking: Open PnL and cumulative realized PnL are displayed live on the chart — the indicator gives strategy-tester-equivalent insight without running a backtest.

🔷 Considerations Before Using the Indicator:
Martingale Tail Risk: Order sizes scale 1.8× per rung, so the deepest fills are by far the largest. If HBAR trends hard below the −25% AO5 level without recovering to take-profit, the virtual position sits fully loaded with no further adds and no stop — Open PnL can grow deeply negative until price reverts.
No Stop Loss: There is no exit signal on adverse moves. Risk is bounded only by the fixed ladder allocation (base + five AOs ≈ $20,633 at default sizing). If a hard exchange-side stop is required, configure it on the bot directly.
Match Sizing to Your Bot: The avg-entry and PnL display becomes meaningful only when the indicator's base/AO sizing matches your real DCA Bot configuration.
Cross Detection Granularity: Base, safety-order, and take-profit events 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 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.
Backtesting Note: This is an indicator, not a strategy. There is no built-in P&L tester — but the live realized-PnL counter in the status table gives a running approximation. For full metrics over the reference ~30-month sample (81 closed trades, 82.72% win rate, 0.92% max drawdown, profit factor 11.248, +3.90% net return over January 1, 2024 – July 2, 2026), use the companion strategy version on identical parameters. Note the 81-trade sample is below the ~100-trade floor for statistical confidence — treat those metrics, including the high profit factor, as indicative.

🔷 How to Use It:
🔸 Add the indicator to a 4h HBAR / USDT chart.
🔸 Confirm the RSI level (28), the five AO deviations and sizes, and the take-profit percentage match your bot's configuration. Match the base/AO sizing so the avg-entry and PnL display stays meaningful.
🔸 In the DCA Bot Webhook group, paste the Bot ID, Email Token, and Pair (QUOTE_BASE format, e.g., USDT_HBAR).
🔸 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 base order, each safety order, and the close will each emit a dedicated JSON payload formatted for direct DCA Bot consumption.

🔷 INDICATOR SETTINGS
Base Order Size: Virtual capital committed on the first (base) entry.
AO Deviations: Fixed percentage distances from the base entry where each safety order fires.
AO Sizes: Virtual capital per safety order (1.8× scaling by default).
RSI Timeframe / Length / Level: Oversold filter for the base entry (default 4h, 14, below 28).
Take Profit (%): Distance above average entry where the full position closes.
DCA Bot Webhook: Bot ID, Email Token, and Pair fields injected into every alert payload.
Visualization: Toggle the AO ladder, fill labels, avg/TP lines, and status table (shows status, AOs filled, base/avg entry, TP target, deployed capital, open PnL, RSI, and cumulative realized PnL).
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提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。