Good Day
I am trying to build a money management algorithm that will base exposure on maximum drawdown.The initial exposure will be set according to the backtest result.
The drawdown value will be set according to the backtest result.
I have been thinking along the lines of using the StrategyProfit command to always store the highest profit level as well as the lowest profit level along with their respective positions using barindex and tradeindex.
Then depending on whether a new high profit was made before a new low (and vice versa) calculate the difference between the two levels as the max drawdown.
Have anyone else tried calculating the running max drawdown of their strategy?
The problem with all this running performance data is that it all resets to zero if you only make the slightest change to your strategy. 🙁
It reminds me of something almost similar, in an old topic in the french section: https://www.prorealcode.com/topic/coding-gainspertes-indicator-need-help/
It may be a good start for your max drawdown indicator.
You are not helping you know 😉 If we were able to export variables and their values and then import or call them it would be nice.
Another one to add the neverending list of PRT recommendations…