Ive been playing around with the reinvesting profits aspect of script writing and I have a few questions for anyone that can answer.
When I check the tutorials and manuals Im finding multiple different code for reinvesting profits, and when testing they all seem to achieve different results.
http://zorro-trader.com/manual/en/tutorial_kelly.htm
if(OptimalFLong > 0 and OptimalFShort > 0)
Margin = (100+0.2*Equity)*(OptimalFLong+OptimalFShort);
Equity for starters is not in Zorro's variables but the help says that Balance + TradeVal = Equity. Should that be used there instead? I have tried it and whenever I changed the 0.2 factor to another number for example 0.5 the result didn't change. Another idea I had was to try Profits or even WinTotal - LossTotal instead of Equity but Im sure they dont work correctly as the capital required always rises alot.
From WorkShop 6_2 script in Zorro.
if(Train)
Lots = 1;
else if(OptimalFLong > 0) {
Lots = 1;
Margin = clamp(Balance * OptimalFLong * 0.1, 5, 1000);
} else if(OptimalFShort > 0) {
Lots = 1;
Margin = clamp(Balance * OptimalFShort * 0.1, 5, 1000);
} else
Lots = 0; // switch off trading
This is the example from the actual script on Zorro minus the Algos just for being run on a single strategy.
http://forums.babypips.com/expert-adviso...y-design-3.html
if(Train)
Lots = 1;
else if(OptimalFLong > 0) {
Lots = 1;
Margin = clamp((WinLong-LossLong) * OptimalFLong/2, 50, 10000);
} else if(OptimalFShort > 0) {
Lots = 1;
Margin = clamp((WinShort-LossShort) * OptimalFShort/2, 50, 10000);
} else
Lots = 0;
And I found this example from Babypips, like all have very different effects on my strategy and in most cases makes the required capital rise. Any help in understanding reinvesting profits more throughly will be appreciated.