Quote from traderkay:
The link is de-funct.
For some reason, the link is getting changed when I cut and paste it. Here's a copy of the post:
Edge Test
I wrote a couple of programs. The first has a test trading system and writes a trade file with the entry date, length of hold in days and profit or loss in pts. with slippage included. The core code has to be changed for each idea that tested well in TS.
For the second program, I enter the year(s) of the test, the market being tested, and whether it is a test for longs or shorts.
I also have to enter the total profits generated from the original system (in pts.) for either longs or shorts. It then reads the trade file and selects the trades that are for the test period. It also reads a back-adjusted continuous file for the symbol and loads the data for the test year(s) in memory. Then it just does 5000 passes of random entries within the test period on the continuous data with a hold equal to each of the trade lengths.
A array is marked to signal that the period was already used to prevent trade overlap during each pass. After each pass through the trade list, it saves the net profit/loss in a array. After the 5000 tests are done, the array is sorted from lowest to highest profits. Then it goes down the list to find out where the profits from the system fit within the tests. Ex. If the system test made 240 pts. profit in the SP market, it would scan through the 5000 trade runs to find out how many it beat. If it beat 4000 of the trade runs, then the system achieved a result of 80% versus a expected random result of near 50%. I also print out the 50%, 90%, 95%, and 99% ranks to get an idea of the possibilities in the market. If the longs and shorts both test above 70% for 3-5 separate years, I start trading it. It doesn't mean it won't have drawdowns, it just means I'm trading a edge that's likely to have better results than random.
For daytrading, I only test a model to do the entries and exit at end of day on close (no stops or profit targets). This way, I've been able to find ideas that have an edge versus just mapping to the character of the market.
Now, if only a software vendor would add this to their backtesting, everyone could avoid developing curve-fit systems and just trade with edges....