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
196 lines of Pine Script v5 from backtest/pinescript/2_hedge_scalp_profit.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
Hedge Scalp - Cumulative Profit builds a short EMA and places four long grid levels plus one deeper short hedge level as percentages below that EMA. Equity shares of a USDT deposit size each entry. Long and short take-profit percentages close the simulated positions, while a date range limits the calculation. The modelled long side has no stop loss and relies on the hedge.
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.
XAU Scalp v2 is an indicator that calculates a composite trading score using multiple components for XAUUSD gold. It stacks four EMAs to determine trend direction and strength, overlays SuperTrend signals derived from ATR(10), adds RSI(14) momentum, detects Bo
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 price-chart indicator builds a fast-minus-slow Jurik moving average of the selected price and wraps that series in upper and lower bands set by a standard-deviation multiplier and the fast lookback. It reads band direction, whether both bands rise or fall
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
Greeffer's Scalping Indicator overlays higher-timeframe exponential moving averages, Bollinger Bands, and Donchian channels on the price chart. It flags a long when price touches the lower Donchian and lower band while the faster averages are not stacked beari
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