The workshop about money management talks about the square root rule and proposes the following formula for money management:

Code:
Margin = 0.5 OptimalF * Capital * sqrt(1 + ProfitClosed/Capital);



Now the trade statistics page says "Trade statistics are updated on every bar. They are reset when the strategy is restarted. For preventing this, they could be copied into global variables or saved in a file that is loaded at start of the strategy."

So this means, the money management with the above formula only works when I never restart the strategy as when I do ProfitClosed will be reset to 0 right?

How can I make it work the right way, even when restarting the strategy? Save ProfitClosed on every bar in a file and restore it in the INITRUN and add that value to the zorro ProfitClosed value?
Or store it in AlgoVars (but there is only a limited amount of them). What about global variables are they somehow stored?