The Hedge Scalp indicator calculates an Exponential Moving Average (EMA) and generates four long grid levels and one hedged short grid level at user-defined percentage distances below the EMA.
1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
207 lines of Pine Script v5 from backtest/pinescript/1_hedge_scalp.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
Hedge Scalp models grid entry execution and average entry take-profit levels for scalp strategies. Settings allow customization of the EMA length, individual percentage grid offsets, long and short take-profit percentages, and position sizing allocations per level. It displays directly on the main price chart.
EMA-based percentage grid calculations
Four long grid levels and one hedged short grid level
Customizable take profit percentages based on average entry
Configurable equity allocation percentage per grid entry
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
EMA Lenght
int
2
ema_lenght
1 Grid (in %)
float
0.5
grid_1_long_inp
2 Grid (in %)
float
1
grid_2_long_inp
3 Grid (in %)
float
1.5
grid_3_long_inp
4 Grid (in %)
float
2
grid_4_long_inp
5 Grid hedged (in %)
float
2.5
grid_5_short_inp
Long Take Profit (in %)
float
0.5
long_tp_inp
Short Take Profit (in %)
float
1.6
short_tp_inp
Strategy Deposit (USDT)
int
1000
deposit
Comission (%)
float
0.04
comission
Long Entry 1 - Equity in % from total
float
2.17
n1
Long Entry 2 - Equity in % from total
float
4.35
n2
Show all 17 settings
Setting
Type
Default
Variable
Long Entry 3 - Equity in % from total
float
8.7
n3
Long Entry 4 - Equity in % from total
float
18.2
n4
Short Entry 5 - Equity in % from total
float
66.67
n5
Start Date
time
timestamp("1 Jan 2024 00:00")
StartDate
End Date
time
timestamp("1 Jan 2099 01:00")
EndDate
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.
This overlay indicator marks CALLS and PUTS labels on the price chart when a strict boolean gate of price structure, momentum, volatility, breadth, and candle confirmation all pass. It plots an EMA ribbon with cloud fill, session-anchored VWAP and standard-dev
This indicator plots a Price Action Channel (PAC) based on high, low, and close moving averages alongside fast, medium, and slow trend EMAs directly on the price chart. It detects regular and Bill Williams fractals to track market structure and identifies pull
Moving Average Channel plots separate simple moving averages for upper and lower bands on the price chart. It fills the space between bands with semi-transparent color and colors bars green above the upper band, red below the lower band, or gray in between. Us
This indicator scans NSE-listed stocks for momentum signals using Supertrend, multiple EMAs, MACD, and stochastic oscillator. It supports continuous or flip signal modes and displays matching setups in a customizable table at the bottom left of the chart. The
This indicator calculates pivot high and pivot low points on the price chart based on configurable left and right bar counts. Confirmed pivot highs and lows are plotted with negative bar offsets directly on the price chart using line and cross styles. Addition
This overlay indicator marks call and put setups from EMAs, RSI, MACD, and a SPY volume ratio. A call needs higher highs, RSI above its minimum, rising MACD, above-average proxy volume, and a rising trend EMA; a put reverses those tests. Early markers use an E