Quote from Indrionas:
I could try this experiment too. But there's one thing unclear to me. There are average winning trade and average losing trade sizes specified. I bet he assumes normal distribution, this means you need to know standard deviation to simulate these variates. I'm quite sure deviation doesn't affect expected profit factor, but my bet it would relate to dispersion of sorted monte carlo results (not the 50th percentile though).
There also another technical detail. What to do if you draw negative "winning trade" or positive "losing trade"? For instance:
you draw standard normal value of -1.5, if mean is 200 and standard deviation is 200, that makes 200 -1.5*200 = -100. What do you do? Ignore and re-draw again? If so, you won't get a normally distributed variable with specified parameters. You would get chopped off, skewed to the right distribution.
I didn't use a normal distribution for the trade draws. I used binary outcomes (if you win, you win this much, if you lose, you lose that much). I took his average profit, average loss, and win percentage only as a description of the profit factor. I'll post some pseudo code describing what I did. If you implement something using normal draws, let me know what you find.
First I found the win to loss ratio. With 50% wins, that is equal to 1.5 (the profit factor). More generally:
winLossRatio = profitFactor * (1.0 - percentageProfitable) / percentageProfitable;
To calculate the expected outcome:
balance = startBalance;
for each trade
{
risk = balance * tradeRiskPercent;
reward = winLossRatio * risk;
result = reward * percentageProfitable - risk * (1.0-percentageProfitable);
balance = balance + result;
}
To calculate each monte carlo run:
balance = startBalance;
for each trade
{
risk = balance * tradeRiskPercent;
reward = winLossRatio * risk;
isProfit = nextRand(0, 1) < percentageProfitable;
if(isProfit) result = reward;
else result = -risk;
balance = balance + result;
}