Calculate DD from CSV

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #252714 quote
    SnorreDK
    Participant
    Junior

    Hello,

    ​Simple question:

    ​I want to calculate  Maximum Drawdown (MDD) using data exported from the ProRealTime ProBacktest report (CSV file).

    Is it possible for my external calculation to match the exact MDD value shown in the ProRealTime platform’s statistical report?

    ​If so, what specific data field(s) do I need to ensure are included in the CSV export to achieve this match?

    ​Thank you.

    #252717 quote
    robertogozzi
    Moderator
    Master
    This is the calculation:
    // DrawDown
    //
    ONCE Capital  = 10000
    ONCE MaxPoint = 0
    ONCE MaxDD    = 0
    //------------------------------------------
    //       EQUITY
    Equity        = Capital + StrategyProfit
    TempProfit    = PositionPerf * PositionPrice / PipSize * PipValue //   / abs(CountOfPosition)
    TempEquity    = Equity + TempProfit
    //------------------------------------------
    //       DrawDown
    MaxPoint      = max(MaxPoint,TempEquity)
    DD            = MaxPoint - TempEquity
    MaxDD         = max(MaxDD,DD)
    DDperc        = MaxDD * 100 / Capital
    You need to provide yourself the Capital, then you will have to provide what is needed to compute the following data:
    • StrategyProfit
    • PositionPerf
    • PositionPrice
    • PipSize
    • PipValue
    • CountOfPosition
    Iván González thanked this post
    #252722 quote
    SnorreDK
    Participant
    Junior
    Thanks roberto but how do i get this as part of cvs export for my strategy?
    #252723 quote
    SnorreDK
    Participant
    Junior
    Another qurstion in same subject   I’m backtesting a trading system designed to operate on a Daily (1 Day) timeframe (e.g., entry/exit signals are only generated at the close of the daily candle). ​I want to calculate the most realistic Maximum Drawdown (MDD) for this strategy. ​My question pertains to the resolution of the data required for this crucial metric: ​Close-to-Close MDD: If I calculate MDD based only on the daily Close of the strategy’s equity curve, it will miss any deep pullbacks that occur intraday (floating P&L). ​Intraday MDD: To capture the true worst-case scenario (Peak Equity to Trough Equity), is it best practice to analyze the strategy’s P&L using 1-minute (1m) historical data? ​Specifically, for a strategy that only trades once a day, should the MDD reporting rely on high-resolution 1-minute data to accurately reflect the maximum potential adverse excursion (MAE) experienced by the open position? ​Any insights into how professional backtesters or ProRealTime handles this distinction would be greatly appreciated. ​Thank you!
    #252726 quote
    robertogozzi
    Moderator
    Master
    As to the above list:
    • StrategyProfit you need to have prices and simulate a trade to know what the outcome would be (open, close, etc…)
    • PositionPerf as for StrategyProfit, you need to have prices and simulate a trade to know what the temp outcome would be candle by candle (open, close, etc…)
    • PositionPrice it’s the entry price of the simulated trade (or the average price if you accumulate positions)
    • PipSize you know it, as it’s related to the instrument you want to trade, it’s usually 1 for indices and 0.0001 for FX pairs, but not for JPY pairs and for other assets like shares (make an idicator with the single line  RETURN PipSize to know it
    • PipValue same as above but replacing that line with RETURN PipValue
    • CountOfPosition the number of positions traded in your simulation
    Iván González thanked this post
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Calculate DD from CSV


General Trading: Market Analysis & Manual Trading

New Reply
Author
author-avatar
SnorreDK @snorredk Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by robertogozzi
3 months, 3 weeks ago.

Topic Details
Forum: General Trading: Market Analysis & Manual Trading
Language: English
Started: 10/18/2025
Status: Active
Attachments: No files
Logo Logo
Loading...