OPEN-SOURCE SCRIPT
Momentum Long + Short Strategy (BTC 3H)

Momentum Long + Short Strategy (BTC 3H)
đ How It Works, Step by Step
Detect the Trend (đ/đ)
Calculate two moving averages (100-period and 500-period), either EMA or SMA.
For longs, we require MA100 > MA500 (uptrend).
For shorts, we block entries if MA100 exceeds MA500 by more than a set percentage (to avoid fading a powerful uptrend).
Apply Momentum Filters (âĄïž)
RSI Filter: Measures recent strengthâonly allow longs when RSI crosses above its smoothed average, and shorts when RSI dips below the oversold threshold.
ADX Filter: Gauges trend strengthâensures we only enter when a meaningful trend exists (optional).
ATR Filter: Confirms volatilityâavoids choppy, low-volatility conditions by requiring ATR to exceed its smoothed value (optional).
Confirm Entry Conditions (â )
Long Entry:
Price is above both MAs
Trend alignment & optional filters pass â
Short Entry:
Price is below both MAs and below the lower Bollinger Band
RSI is sufficiently oversold
Trend-blocker & ATR filter pass â
Position Sizing & Risk (đ°)
Each trade uses 100 % of account equity by default.
One pyramid addition allowed, so you can scale in if the move continues.
Commission and slippage assumptions built in for realistic backtests.
Stops & Exits (đ)
Long Stop-Loss: e.g. 3 % below entry.
Long Auto-Exit: If price falls back under the 500-period MA.
Short Stop-Loss: e.g. 3 % above entry.
Short Take-Profit: e.g. 4 % below entry.
đš Why Itâs Powerful & Customizable
Modular Filters: Turn on/off RSI, ADX, ATR filters to suit different market regimes.
Adjustable Thresholds: Fine-tune stop-loss %, take-profit %, RSI lengths, MA gaps and more.
Multi-Timeframe Potential: Although coded for 3 h BTC, you can adapt it to stocks, forex or other cryptosâjust recalibrate!
Backtest Fine-Tuned: Default settings were optimized via backtesting on historical BTC dataâbut theyâre not guarantees of future performance.
â ïž Warning & Disclaimer
This strategy is for educational purposes only and designed for a toy fund. Crypto markets are highly volatileâyou can lose 100 % of your capital. It is not a predictive âholy grailâ but a rules-based framework using past data. The parameters have been fine-tuned on historical data and are not valid for future trades without fresh calibration. Always practice with paper-trading first, use proper risk management, and do your own research before risking real money. đšđ
Good luck exploring and experimenting! đđ
đ How It Works, Step by Step
Detect the Trend (đ/đ)
Calculate two moving averages (100-period and 500-period), either EMA or SMA.
For longs, we require MA100 > MA500 (uptrend).
For shorts, we block entries if MA100 exceeds MA500 by more than a set percentage (to avoid fading a powerful uptrend).
Apply Momentum Filters (âĄïž)
RSI Filter: Measures recent strengthâonly allow longs when RSI crosses above its smoothed average, and shorts when RSI dips below the oversold threshold.
ADX Filter: Gauges trend strengthâensures we only enter when a meaningful trend exists (optional).
ATR Filter: Confirms volatilityâavoids choppy, low-volatility conditions by requiring ATR to exceed its smoothed value (optional).
Confirm Entry Conditions (â )
Long Entry:
Price is above both MAs
Trend alignment & optional filters pass â
Short Entry:
Price is below both MAs and below the lower Bollinger Band
RSI is sufficiently oversold
Trend-blocker & ATR filter pass â
Position Sizing & Risk (đ°)
Each trade uses 100 % of account equity by default.
One pyramid addition allowed, so you can scale in if the move continues.
Commission and slippage assumptions built in for realistic backtests.
Stops & Exits (đ)
Long Stop-Loss: e.g. 3 % below entry.
Long Auto-Exit: If price falls back under the 500-period MA.
Short Stop-Loss: e.g. 3 % above entry.
Short Take-Profit: e.g. 4 % below entry.
đš Why Itâs Powerful & Customizable
Modular Filters: Turn on/off RSI, ADX, ATR filters to suit different market regimes.
Adjustable Thresholds: Fine-tune stop-loss %, take-profit %, RSI lengths, MA gaps and more.
Multi-Timeframe Potential: Although coded for 3 h BTC, you can adapt it to stocks, forex or other cryptosâjust recalibrate!
Backtest Fine-Tuned: Default settings were optimized via backtesting on historical BTC dataâbut theyâre not guarantees of future performance.
â ïž Warning & Disclaimer
This strategy is for educational purposes only and designed for a toy fund. Crypto markets are highly volatileâyou can lose 100 % of your capital. It is not a predictive âholy grailâ but a rules-based framework using past data. The parameters have been fine-tuned on historical data and are not valid for future trades without fresh calibration. Always practice with paper-trading first, use proper risk management, and do your own research before risking real money. đšđ
Good luck exploring and experimenting! đđ
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.
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.
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.