GreatPig
Pigs In Space
- Joined
- 9 July 2004
- Posts
- 2,368
- Reactions
- 14
It is a form of Monte Carlo testing. The way I see it, randomly rejecting trades is much the same as randomly picking trades from the available signals, as long as you don't reject so many that the sparsity of signals biases the results too much._ExY_ said:This method seems to resemble monte carlo whereas instead of randomly selecting trades at random your simply rejecting them(is there any difference?!)
Normally trades are selected based on preference rules, when more than one is available at a time. Randomising which of those trades is selected goes part way towards Monte Carlo testing, but unless your system gives lots of signals, there may be certain signals which will always be picked up simply because they are the only signals available at that time, especially in a shorter-term system. If one that's always picked up is a huge winner, then all your Monte Carlo results will be biased by that same trade, as you may never get a backtest without that trade in it. By randomly rejecting signals though, you will eventually get backtests where that trade is rejected, and will thus see some results that don't include it.
Also, this allows you to test your selection preference rules by keeping those rules (rather than randomising the selection) and simply rejecting some trades at random to ensure you get a variety of portfolios. At least then if a signal is rejected, the next most preferred one will be chosen rather than just a random one.
No idea about MS/Tradesim programming, but in AmiBroker I set a variable called MonteCarlo to some percentage (actually a fraction between 0-1) and then use the formula:
Buy = Buy AND Random() > MonteCarlo;
The larger you make MonteCarlo, the less chance the random value will be larger than it and thus the more chance that the buy signal will be wiped out.
Note though that if you're using the scale-in or scale-out values in the Buy array, to retain those values you'd need to write it as:
Buy = IIf(Random() > MonteCarlo, Buy, False);
although I'm not sure that you'd want to randomly drop scale-out signals.
I'm not saying that this is a perfect way of doing Monte Carlo testing, but I think it's better than just randomising the signal selection at any bar (which in AmiBroker means setting the PositionScore variable to Random).
Cheers,
GP