Strategy · Pine Script v6 · On the chart

Hedge Short Setup Backtest (with SL+TP)

by shitcoding

This strategy backtests short entry setups by evaluating multiple confluence factors directly on the price chart.

View on GitHub

GitHub stars3on the repository
Pine versionv6current
Lines of code110
Settings23inputs
LicenceNone stated
Last update1 year ago15 Oct 2025

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

Source Code

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

Hedge Short Setup Backtest (with SL+TP) combines price surge detection, RSI overbought conditions with rollover confirmation, Bollinger Band exhaustion, and optional volume spikes alongside an EMA trend filter. When the chosen confluence threshold is met, it executes a short trade. Exits are managed dynamically using ATR-based stop loss and take profit targets.

Details

Published by

shitcoding on GitHub

Draws

On the price chart

Markets

Crypto

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Topics

pinescripttradingview

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Use % Surge conditionbooltrueuseSurge
Lookback barsint72surgeLb
Price ↑ over lookback ≥ (%)float10.0surgePct
Use RSI overbought & roll-overbooltrueuseRSI
RSI Lengthint14rsiLen
RSI Overbought Levelint70rsiOb
Require RSI rolling over (RSI < RSI[1])booltrueneedRoll
Use Bollinger exhaustion filterbooltrueuseBB
BB Lengthint20bbLen
BB StdDev Multfloat2.0bbMult
Exhaustion LogicstringTouch+Re-entrybbMode
Require volume spikeboolfalseuseVol
Show all 23 settings
SettingTypeDefaultVariable
Volume SMA Lengthint20volLen
Volume ≥ SMA ×float1.5volMult
Trend FilterstringOfftrendMode
EMA length for trendint200emaLen
Min confluence for BASEint2minConf
Min confluence for STRONGint3strongConf
Fire on bar close onlybooltruefireOnClose
Avoid repeated signals (cluster)booltrueoneShot
ATR Lengthint14atrLen
Stop Loss = ATR ×float1.5atrSLx
Take Profit = ATR ×float1.0atrTPx
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

6 stars

Capital41 Fusion Core Strategy is an overlay trading strategy that combines an exponential moving average trend filter, RSI, Williams %R, and volume/ATR expansion into a composite momentum oscillator. It executes long trades when the smoothed oscillator crosse

Strategy v6 TrendOscillators & momentum
Updated 2 months ago · MIT GitHub repository of Capital41 Fusion Core Strategy

This strategy executes trades on gold based on a confluence of Supertrend, RSI, MACD, Bollinger Bands, and volume spikes. It enters long or short positions when trend direction aligns with momentum and price positioning relative to volatility bands, filtered b

Strategy v6 TrendOscillators & momentum
Updated 1 year ago · None stated GitHub repository of XAUUSD High Probability Strategy

Parabolic SAR

by g-moe
3 stars

This strategy overlays a smoothed moving average on price and combines it with Aroon, Chaikin Money Flow and a Chaikin oscillator to define long and short conditions. Relative Vigor Index and Parabolic SAR values are calculated for exits. Entries can be limite

Strategy v5 TrendOscillators & momentum
Updated 5 months ago · None stated GitHub repository of Parabolic SAR
2 stars

This strategy calculates MACD, ADX trend strength, ATR, and a rolling VWAP resetting at fixed bar intervals. It plots the VWAP line, stop loss levels, and profit targets directly on the price chart. Long positions enter when MACD crosses above its signal line

Strategy v5 TrendOscillators & momentum Repaints
Updated 8 months ago · MIT GitHub repository of MACD & VWAP Strategy with ATR SL/Targets

This strategy generates trade entries by combining up to five normalized 0-100 technical indicators: Relative Strength Index (RSI with divergence detection), Stochastic RSI, Money Flow Index (MFI), Relative Volatility Index (RVI), and Average Directional Index

Strategy v5 Oscillators & momentumVolatility & bands
Updated 1 year ago · None stated GitHub repository of TLC 0TO100 Five Indicators Strategy

12-BB

by sam30606
1 stars

This overlay strategy combines a Bollinger-style band with separate ATR upper and lower envelopes and optional ADX, Volume Flow Indicator, and RSI filters. It sizes positions as a percentage of equity. Settings change band length and multiplier, ATR periods an

Strategy v5 TrendOscillators & momentum
Updated 3 years ago · None stated GitHub repository of 12-BB

More Oscillators & momentum scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers