In a test strategy I'm working with I get the following OptF results after adding Margin and reinvestment:
Quote:
Annual growth rate 129%
Profit factor 1.67 (PRR 1.34)
Sharpe ratio 0.85
Kelly criterion 0.15
Ulcer index 14%
Prediction error 42%
Cycle performance 1.84 1.83 1.79 1.45 1.64 1.83 1.69 1.82

Portfolio analysis OptF ProF Win/Loss Wgt% Cycles

EURUSD .505 1.82 53/229 134.9 X//X
EURUSD:L .164 1.32 34/155 4.0 \///
EURUSD:S .999 1.86 19/74 130.9 ///\


I noticed in the testtrades.csv log, it is calculating lots for Shorts far bigger than Longs, sometimes 10x more. That may all be correct (if so, that's what I want). But it seems abnormal that OptF is .999 -- can you confirm that is correct?

Here is the code I'm using for reinvestment. Please advise if you have any suggestions here. I see various code for this around the forum and help pages, but this seems to be one of the more recent calculations:
Code:
//reinvest a portion of profits
	int reinvestprofits = 1; //invoke margin setting during trade logic
	Capital = 1000; //simulate starting account with $1000
	var MarginLong = OptimalFLong * Capital * sqrt(1 + (WinLong-LossLong)/Capital);
	var MarginShort = OptimalFShort * Capital * sqrt(1 + (WinShort-LossShort)/Capital);



Thank you