OPEN-SOURCE SCRIPT
Pump-Smart Shorting Strategy

This strategy is built to keep your portfolio hedged as much as possible while maximizing profitability. Shorts are opened after pumps cool off and on new highs (when safe), and closed quickly during strong upward moves or if stop loss/profit targets are hit. It uses visual overlays to clearly show when hedging is on, off, or blocked due to momentum, ensuring you’re protected in most market conditions but never short against the pump. Fast re-entry keeps the hedge active with minimal downtime.
Pump Detection:
Cooldown and Re-Entry:
New High Entry:
Take Profit (TP) & Stop Loss (SL):
Preemptive Exit:
Visual Feedback:
Pump Detection:
- RSI (Relative Strength Index): Calculated over a custom period (default 14 bars). If RSI rises above a threshold (default 70), the strategy considers the market to be in a pump (strong upward momentum).
- Volume Spike: The current volume is compared to a 20-bar simple moving average of volume. If it exceeds the average by 1.5× and price increases at least 5% in one bar, pump conditions are triggered.
- Price Jump: Measured by (close - close[1]) / close[1]. A single-bar change > 5% helps confirm rapid momentum.
- Pump Zone (No Short): If any of these conditions is true, an orange or red background is shown and shorts are blocked.
Cooldown and Re-Entry:
- Cooldown Detection: After the pump ends, RSI must fall below a set value (default ≤ 60), and either volume returns towards average or price momentum is less than half the original spike (oneBarUp <= pctUp/2).
- barsWait Parameter: You can specify a waiting period after cooldown before a short is allowed.
- Short Entry After Pump/Cooldown: When these cooldown conditions are met, and no short is active, a blue background is shown and a short position is opened at the next signal.
New High Entry:
- Lookback New High: If the current high is greater than the highest high in the last N bars (default 20), and pump is NOT active, a short can be opened.
Take Profit (TP) & Stop Loss (SL):
- Take Profit: Short is closed if price falls to a threshold below the entry (minProfitPerc, default 2%).
- Stop Loss: Short is closed if price rises to a threshold above the entry (stopLossPerc, default 6%).
Preemptive Exit:
- Any time a pump is detected while a short position is open, the strategy closes the short immediately to avoid losses.
Visual Feedback:
- Orange Background: Market is pumping, do not short.
- Red Background: Other conditions block shorts (cooldown or waiting).
- Blue Background: Shorts allowed.
- Triangles/Circles: Mark entries, pump start/end, for clear trading signals.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, penulis skrip ini telah menjadikannya sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Hormat untuk penulisnya! Meskipun anda dapat menggunakannya secara gratis, ingatlah bahwa penerbitan ulang kode tersebut tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, penulis skrip ini telah menjadikannya sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Hormat untuk penulisnya! Meskipun anda dapat menggunakannya secara gratis, ingatlah bahwa penerbitan ulang kode tersebut tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.