Does anyone know how to use the monte carlo analysis in AB?
I use the code shown below for Monte Carlo analysis. I usually set the monte carlo figure to 0.5. ie. there is a 50% chance I may miss this trade or I won't like the buy signal generated for whatever reason. You may set the figure lower if you were more confident about your system and your ability to place all the trades it produces. Regardless, a graph of CAR vs MaxSysDD (for example) should ideally show a tight spread of results, if it doesn't perhaps your system is not as robust as you first thought.
You can also go further. For example, export your optimized monte carlo run into excel and work out the standard deviation for various results, and work out various probabilities. eg. the average CAR of 1000 monte carlo runs is 30%, with a standard deviation of 5% (approx 70% of the runs lie in the 25% to 35% range), and I have a 90% chance of having a CAR > 20%.
I find this methodology to be beneficial in system testing / evaluation.
Mark
Code:
runs = Param("# runs", 1000, 0, 10000, 500);
monteCarlo = Param("monteCarlo", 0, 0, 1.00, 0.01);
if(monteCarlo)
Optimize("monteCarlo", 1, 1, runs, 1);
if(monteCarlo)
Buy = Buy AND mtRandom() >= monteCarlo;
else
Buy = Buy;