[3Commas] Trail Hunter - Reversal Long β€” Strategy by 3Commas

By 3Commas

Performance Metrics

Description

[3Commas] Trail Hunter - Reversal LongπŸ”· What it does:This strategy hunts mean-reversion long entries on liquid instruments using a dual-indicator confluence β€” a moving-average cross-under combined with a CCI oversold confirmation. Once a position opens, the exit is managed through a trailing take-profit that activates at a configurable profit level and follows price upward with a tight deviation, locking in gains while letting strong moves run. A hard stop loss caps downside on invalidation. No DCA, no safety orders β€” one entry, one trailing exit, one stop. - Entry: SMA(24) crosses below SMA(31) AND CCI(11) crosses below -80 (within configurable signal alignment window) - Exit: Trailing take-profit, activation at +1.5%, trailing deviation 0.05% - Hard Stop: βˆ’3.25% from entry - Single entry per cycle; no averaging or safety order ladderπŸ”· Who is it for: Mean-reversion traders who want a single-entry framework without DCA complexity. Bot operators who automate execution through webhook integration with a DCA Bot. Traders who prefer trailing exits over fixed take-profit targets for capturing extended moves. Cross-instrument users who run the same signal framework across crypto perpetuals, spot pairs, and equity indices.πŸ”· How does it work: Long Entry: A long position opens when two conditions align - SMA(24) crosses below SMA(31) AND CCI(11) drops below βˆ’80, both detected on the signal timeframe. The strategy uses a configurable signal keep-alive window so the two confirmations do not need to fire on the exact same bar - they just need to overlap within a small number of bars to count as a valid setup. Short Entry: Not used - strategy is long-only by design. Exit Management: Once filled, two exit conditions are armed simultaneously. The trailing take-profit activates when price reaches Entry Γ— (1 + Take Profit %), then follows the highest price reached with a deviation gap; if price retraces by the deviation amount from the peak, the position closes. The hard stop loss closes immediately if price drops to Entry Γ— (1 βˆ’ Stop Loss %). Whichever fires first wins.πŸ”· Why it's unique: Dual-indicator confluence - neither signal acts alone. The MA cross-under confirms short-term momentum exhaustion against the medium-term trend, and the CCI extreme confirms statistical oversold conditions. Requiring both filters out single-indicator false positives common to either condition alone, especially during sideways regimes. Trailing-exit architecture - fixed take-profits cap gains on trending moves. The trailing exit lets a strong rebound run while protecting the activation-level profit with a tight deviation. On instruments that mean-revert with sharp upward bounces, this design captures significantly more than a fixed +1.5% close would. Bot Integration - entry and exit alerts ship with webhook-ready JSON payloads, enabling direct trigger of a connected DCA Bot. Bot ID, Email Token, and pair label are exposed as inputs and automatically embedded into the alert message format.πŸ”· Considerations Before Using the Indicator: Market & Timeframe: Designed for 1-hour base charts on liquid instruments with frequent intraday MA crossings - major crypto perpetuals (BTC, ETH, SOL), spot pairs on Coinbase and Bybit, and high-volume equity tickers. Performance degrades on illiquid altcoins where the MA pair (SMA 24 vs 31) rarely crosses or where CCI rarely touches βˆ’80. The signal timeframe is configurable independently of the chart timeframe. Limitations: This is a single-entry strategy with no averaging mechanism. If the entry is wrong and price continues against the position, the hard stop loss at βˆ’3.25% caps the loss but does not recover. The strategy does not include a regime filter, so it can enter long during sustained downtrends if the dual signal aligns. For deployment in bearish conditions, consider adding a higher-timeframe trend filter (e.g., 4h or daily moving average direction) above the entry logic. Backtesting & Demo Testing: Always validate across multiple market regimes - uptrend, downtrend, and ranging - before deploying real capital. The trailing exit behavior is sensitive to instrument volatility and intra-bar tick density, so live performance can deviate from backtest if the venue has different execution characteristics. Demo-trade for at least one month before live deployment. Past performance is not indicative of future results. Parameter Adjustments: Commission and slippage defaults are calibrated for Bybit linear perpetual taker fees (0.055%). Adjust to match your venue β€” Coinbase Spot taker is ~0.4–0.6%, Binance USD-M Futures ~0.04%, OKX Perpetual ~0.05%. The signal timeframe, MA lengths, CCI threshold, and trailing deviation should all be re-tuned per instrument before going live. Tighter MA pairs and lower CCI threshold for low-volatility assets; the opposite for high-volatility.πŸ”· STRATEGY PROPERTIES Symbol: Cross-instrument - defaults to 1-hour base chart on any liquid pair. Reference testing performed on BTC/USD (COINBASE:BTCUSD). Timeframe: 1h chart, signals on 1h (configurable). Test Period: May 12, 2025 - May 12, 2026 (12 months). Initial Capital: 10,000 USDT. Order Size per Trade: Base Order 41.55858 USDT (β‰ˆ 0.42% of capital per trade). Single entry only - no safety order stacking. Commission: 0.055% taker (Bybit linear default). Adjust per venue. Slippage: 5 ticks - typical taker execution on liquid pairs. Margin for Long and Short Positions: 100% (1Γ— leverage assumed; no margin amplification). Indicator Settings: Default Configuration. MA Type: SMA Fast MA Length: 24 Slow MA Length: 31 MA Cross Timeframe: 1h CCI Length: 11 CCI Oversold Threshold: βˆ’80 CCI Timeframe: 1h Signal Combine: AND Signal Keep-Alive: 3 bars Take Profit (activation): 1.5% Trailing Deviation: 0.05% Stop Loss: 3.25% Strategy: Long Only.πŸ”· STRATEGY RESULTS ⚠️ Remember, past results do not guarantee future performance. Net Profit: +13.09 USD (+0.13%) Max Drawdown: 7.91 USD (0.08%) Total Closed Trades: 66 Percent Profitable: 69.70% (46 / 66) Profit Factor: 1.254 Average winning Trade: 1.83% Average # Bars in Trades: 34 Reference backtest run on COINBASE:BTCUSD on 1h base chart, May 12 2025 - May 12 2026. Re-run on your own venue with venue-specific commission and slippage before drawing conclusions for live deployment.πŸ”· How to Use It: πŸ”Έ Adjust Settings: Set Base Order volume proportional to your account size. The default 41.55858 USDT structure is calibrated for a 10,000-USDT test account, keeping per-trade risk at β‰ˆ 0.4% of capital under the βˆ’3.25% stop. Scale linearly to your equity. MA pair lengths, CCI threshold, and the trailing deviation should be tuned per instrument volatility profile. πŸ”Έ Results Review: Verify Maximum Drawdown stays within your personal risk budget. The strategy is configured for a very conservative per-trade risk envelope, but trade frequency and DD profile shift significantly across instruments and regimes. Re-test on your own venue using venue-specific commission and slippage values. Demo-trade for at least one month before any live deployment. πŸ”Έ Create alerts to trigger the DCA Bot: Two alert messages are exposed by the script - "Deal Start" fires on each new entry, and "Deal Close" fires when either the trailing exit or the stop loss triggers. Configure both alerts in TradingView with the webhook URL pointing to your DCA Bot's signal endpoint. Once configured, the strategy publishes the signal and the bot handles execution on the exchange autonomously.πŸ”· INDICATOR SETTINGS MA Type - Moving average type for entry calculation (SMA or EMA). Fast MA Length - Period of the fast moving average (default 24). Slow MA Length - Period of the slow moving average (default 31). MA Cross Timeframe - Timeframe on which the MA crossing is computed. Use MA Cross signal - Toggle the MA condition on or off in the entry stack. CCI Length - Period for the CCI indicator (default 11). CCI Oversold Threshold - Value below which CCI must cross to qualify as an oversold signal (default βˆ’80). CCI Timeframe - Timeframe on which the CCI crossing is computed. Use CCI signal - Toggle the CCI condition on or off. Combine Signals - AND requires both conditions within the keep-alive window; OR fires entry on either condition alone. Signal Keep-Alive (bars) - Number of bars within which both signals must align for AND mode (default 3). Base Order Volume (USDT) - Notional value of the entry per cycle. Take Profit % (activation) - Profit level at which the trailing exit arms. Enable Trailing Stop - Toggle trailing behavior on the take-profit exit. Trailing Deviation % - Distance from the peak price at which the trailing exit fires. Enable Stop Loss - Toggle the hard stop loss on or off. Stop Loss % (from entry) - Maximum acceptable loss from entry price. Limit by Date Range - Constrain backtest to a specific date window. Stats card / Watermark - Display layer controls for on-chart backtest summary and branding. Webhook - Bot ID, Email Token, and Pair label for DCA Bot signal routing.πŸ‘¨πŸ»β€πŸ’»πŸ’­ 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.Release Notesscript description update

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView