How to Install a Trailing Drawdown Indicator on TradingView
Updated October 10, 2026
The TradeGuard Trailing Floor is a free, open-source (MIT) indicator that draws your high-water mark and a trailing drawdown floor on the chart. Copy the script from GitHub, add it to a TradingView chart, then enter your drawdown amount, the instrument's dollar value per point, and your position size. Setup takes a few minutes.
What it shows
- Blue high-water mark: the highest price since the indicator started (or since the session began, if daily reset is on).
- Red trailing floor: the high-water mark minus your drawdown, converted from dollars into price. It only moves up.
- Extras: red background shading when price closes below the floor, and an alert you can switch on.
It is price-based: it follows the chart's high, not your broker account's equity or fills, and assumes a single long position of the size you enter.
TradingView (Pine Script v5)
- Open
TradeGuardTrailingFloor.pineon GitHub and copy the whole script. - In TradingView, open the Pine Editor at the bottom of the chart.
- Replace everything in the editor with the script, click Save, then Add to chart.
- Click the gear icon next to the indicator name and set Trailing Drawdown Buffer ($), Dollar Value per 1.0 Price Point ($) and Position Contracts / Lots.
- Optional: click Alert and choose the condition Price crossed below TradeGuard floor.
A free TradingView account can add the script to your own charts.
Trading on TradeLocker, DXtrade or Match-Trader?
The indicator is a TradingView script. If your platform's charts don't let you add custom scripts, open the same symbol on a free TradingView chart next to your platform and add the indicator there. It reads price, not your account, so it works the same way.
For your exact floor, buffer and position size from your real balance, use the Prop Firm Drawdown & Position Sizing Calculator. It runs in any browser.
Recommended settings
Set Dollar Value per 1.0 Price Point for 1.00 lot or 1 contract. These are common values; always check your platform's symbol info.
| Instrument | $ per 1.0 price point | Floor distance for $2,000, size 1 |
|---|---|---|
| EUR/USD and other USD-quoted pairs (1.00 lot) | 100,000 | 0.0200 (200 pips) |
| XAU/USD gold (100 oz lot) | 100 | $20 |
| BTC/USD (1 BTC lot) | 1 | $2,000 |
| NQ / MNQ futures | 20 / 2 | 100 / 1,000 points |
| ES / MES futures | 50 / 5 | 40 / 400 points |
For forex, $10 per pip equals 100,000 per 1.0 price move, because one pip is 0.0001.
Troubleshooting
The red floor is far off the chart, or way too close
The dollar value per point doesn't match the instrument. A value of 20 is correct for NQ but wrong for gold, Bitcoin or forex. Check the table above, and a note in the bottom-right corner appears on non-futures charts as a reminder.
The whole chart is shaded red
Price has closed below the floor. Either the market really did fall more than your drawdown from the high, or the settings above are wrong for this instrument.
The floor resets every morning
That's Reset Anchor Each Session/Day. Turn it off if you want the high-water mark to carry across days.
Next steps
- Work out how many lots or contracts fit your remaining buffer with the Prop Firm Drawdown & Position Sizing Calculator.
- Check whether your firm trails intraday or at end of day: Intraday vs end-of-day trailing drawdown.
Get the free Capital Protection Blueprint. Four simple rules for sizing trades around your trailing drawdown, with a worked forex example. Get it on the homepage →