Brady,
Thanks again, i had come to the same conclusion, that is to use 0.92% of my equity, but when i run the strategy with this allocation i do not see improved performance. In fact 100% allocation gives better results, so i really wonder if this thing even is worth or just some theory like many others. I guess that's why the book does not have real trading examples, i think that's why the LSPM based funds do not do all that well, its all theory.
I am very sure that the code is correct because I have used/applied it to the samples in the book and my results match.
here is the code just in case....
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
//double[] arrayPnL = new double[9] { 9, 18, 7, 1, 10, -5, -3, -17, -7 };
//double[] arrayPnL = new double[98] { 1000.1, 2422.1, 1002.1, -595.9, -62.9, 1101.1, -519.9, -1246.9, 93.1, -128.9, -261.9, -220.9, 177.1, -91.9, -239.9, 2051.1, -196.9, -1133.9, -211.9, 166.1, -3196.9, -432.9, -988.9, 3873.1, 381.1, -355.9, 1250.1, 985.1, -2617.9, 254.1, 2690.1, -464.9, -1442.9, -645.9, 337.1, -10.9, -343.9, 2338.1, 839.1, 683.1, 168.1, -322.9, 4800.1, -1504.9, -541.9, -803.9, -1074.9, -1982.9, 2529.1, -975.9, -666.9, 4696.1, 1507.1, -81.9, -105.9, -402.9, 55.1, -16.9, -1325.9, 1604.1, 702.1, -1532.9, -501.9, 2175.1, 550.1, -4855.9, 7629.1, 1963.1, 219.1, 457.1, 724.1, 346.1, -1395.9, -4128.9, 1858.1, -995.9, -104.9, 4.1, -414.9, 2625.1, 318.1, 2392.1, -452.9, 346.1, 1358.1, -62.9, -82.9, -69.9, -357.9, 134.1, -530.9, 193.1, -1128.9, -98.9, 339.1, -342.9, 245.1, -1920.9 };
//double[] arrayPnL = new double[35] { 4.8, 19.45, -2.58, 6.55, 12.52, 4.15, 10.9, 3.67, 3.67, 17.85, -0.61, -29.13, -14.74, 4.7, 4.93, 9.18, 9.4, 3.3, 6.24, 12.12, 2.26, -0.67, 29.08, 5.23, 9.76, -1.09, 9.78, 15.23, 6.3, 7.65, 1.41, 9.22, 3.52, 11.46, 2.2 };
double[] arrayPnL = new double[38] {46.38, 44.47, 26.17, 56.93, 14.13, 19.95, -3.55, -10.28, 1.86, -5.9, 26.44, 52.94, 37.85, 29.27, 38.87, 29.78, -6.47, -23.87, 22.71, 60.17, 30.33, 43.6, 93.84, 70.72, 9.04, 61.88, 108.13, 36.6, 31.96, 6.11, 37.12, 50.59, 94.28, 10.42, 28.12, 25.16, 35.81, 33.94};
double dblMaxDrawDown = 0;
var sortedPnL = arrayPnL.OrderBy(x => x);
Double f = 0.01, dblTWR = 1, dblTWRprev = -99999999;
foreach (int x2 in sortedPnL)
{
dblMaxDrawDown = x2;
break;
}
while (f <= 1.00)
{
for (int j = 0; j < arrayPnL.Count(); j++)
{
//Console.WriteLine("Current value of n is {0}", n);
dblTWR = dblTWR * (1 + f * ((-arrayPnL[j]) / dblMaxDrawDown));
}
if (f > 0.01 && dblTWRprev > dblTWR) break;
dblTWRprev = dblTWR;
dblTWR = 1;
f = f + 0.01;
}
//string ss = "";
}
}
}