0

Here is my calculation which i am using to plot the maximum drawdown in a table on my chart:

MD_total_equity = strategy.equity - strategy.openprofit 
var MD_ATH = MD_total_equity
MD_ATH := math.max(MD_total_equity, nz(MD_ATH[1]))
Final_MD = -math.abs(MD_total_equity / MD_ATH * 100 - 100) * 10

previously i used only "strategy.max_drawdown / strategy.equity) * 100" and it worked but idk if there was a change in tradingview but now my plotted drawdown differs from tv's drawdown as they are calculating it differently

Kevin.G
  • 5
  • 1

0 Answers0