Hi MatPed.

Surely you are right, iīve always avoided to place optimize statements directly in algo scripts, as i tend to do it at a global level. Probably thatīs the reason why i couldnīt optimize the average...

Iīve used lots instead of Margin just for simplicity, but itīs good to know that could be another reason why i couldnīt optimize equity curve trading properly.

Anyway, i see a problem with doing it with averages, this is because we add more parameters to the equation, so we unintentionally increase curve fitting.

You can check the first part of the article and see what i mean, i think applying expectancy or kelly factor over the whole data is a good way of avoiding disasters without adding parameters nor bias. The rolling versions work in a similar way like doing it with averages.

There is people who even just stop trading when they reach MDD95 from Montecarlo.

Thanks.