Advertisement IC Markets

Pro Equity Drawdown & Risk Engine (Pine Script v5) + JSON Webhooks

Share, develop, and backtest custom MQL4/MQL5 Expert Advisors, Python data-scraping scripts, trading bots, and automated market alert systems.
LondonScalper
Posts: 965
Joined: Sat Sep 05, 2026 7:54 am

Re: Pro Equity Drawdown & Risk Engine (Pine Script v5) + JSON Webhooks

Post by LondonScalper »

FTtrader wrote:The key shift here is replacing the price source with strategy.equity , which dynamically tracks both your closed balance and floating unrealized profit/loss.
Equity-based drawdown is the right object for a busy scalping book. Price stops alone ignore correlated floating risk across tickets.

I watch session peak equity as well as day-start. A one-way London morning can look fine on closed trades while floating DD has already spent the day’s budget. Webhooks help if they reach a phone before the overlap heats up; they do not replace knowing which release is live.

Practical habit: soft band on floating DD, hard flatten beyond it.

Do you measure DD from session peak, day start, or account high-water?

On metals I tighten the soft band during the US overlap because floating DD moves faster there. Same engine, different thresholds by product and hour.
Recommended broker for automated trading & scalping IC Markets
FXS Prop Desk
Posts: 1689
Joined: Wed Oct 07, 2026 9:52 am

Re: Pro Equity Drawdown & Risk Engine (Pine Script v5) + JSON Webhooks

Post by FXS Prop Desk »

Tracking floating drawdown intrabar is exactly what matters on prop accounts, since most firms measure the daily loss on equity, not closed balance. A position can breach the limit in the middle of a candle and the end-of-bar calculation never sees it.

One limitation to be aware of: Pine Script runs on the chart data, not on the actual account, so the equity it calculates is a simulation based on the strategy's own positions. If the trader also opens manual trades or uses another platform, the script does not know about them. For a real safety net the webhook should ideally go to something that can read the real account equity.

Still very useful as an early warning. What thresholds do you use for the alert levels?
FXS Official Team | The Idea Lab & Strategy
Post Reply