working system, needs improvement

Discussion in 'Technical Analysis' started by traderkay, Feb 13, 2003.

  1. acrary

    acrary

    An the original results using SP data from 1/1/97 - 6/30/01:
     
    #31     Feb 16, 2003
  2. acrary

    acrary

    Here's the code with the filters:


    vars:rg(0),rg1(0);
    condition1 = close > open and close[1] > open[1] and close[2] > open[2] and close < high;
    condition2 = close < open and close[1] < open[1] and close[2] < open[2] and close > low;
    condition3 = close > xaverage(close,200);
    condition4 = close < xaverage(close,200);
    rg1 = high[1] - low[1];
    if rg1 = 0 then rg1 = .1;
    condition5 = (highest(high,3) - lowest(low,3) < 20 and
    ((time > 1000 and time < 1200) or (time > 1330 and time < 1500)));
    condition6 = (absvalue(open[1]-close[1])/RG1 > .65);
    if condition6 then begin
    if condition5 and condition1 and condition3 and marketposition = 0 then begin
    buy next bar at highest(high,3) stop;
    rg = highest(high,3) - lowest(low,3);
    end;
    if condition5 and condition2 and condition4 and marketposition = 0 then begin
    sell next bar at lowest(low,3) stop;
    rg = highest(high,3) - lowest(low,3);
    end;
    end;
    if marketposition <> 0 then begin
    exitlong at entryprice - rg stop;
    exitlong at entryprice + (rg*.5) limit;
    exitshort at entryprice + rg stop;
    exitshort at entryprice - (rg*.5) limit;
    end;
    setexitonclose;
     
    #32     Feb 16, 2003
  3. dis

    dis

    To the contrary, the lack of optimization is a major drawback. Without optimization, there can be no assurance that the parameters of a system are robust. That aside, a system must be based on some observed non-random market behaviour, not an arbitrary setup (i.e. three red 15-min candles in a row) with some filters thrown in for good measure.
     
    #33     Feb 16, 2003
  4. #34     Feb 17, 2003
  5. Please give example of "observed non-random market behaviour."




     
    #35     Feb 17, 2003
  6. dis

    dis

    Opening range breakout.
     
    #36     Feb 17, 2003
  7. acrary, I was also wondering how would the system do if we were to test since 1985 or whenever big SP started trading. I only have data since 97 for mini.
     
    #37     Feb 18, 2003
  8. acrary

    acrary

    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....
     
    #38     Feb 19, 2003
  9. acrary

    acrary

    Here's the year by year results from Jan. 1 1990 - Dec. 31, 1996
     
    #39     Feb 19, 2003
  10. Eddy

    Eddy

    Acrary,
    your 1990 - 1996 results raises quite an interesting issue :
    the system performed poorly on this period. I would say this might show that this system has no "specific" edge, but i think it doesn't mean it will perform badly for the coming year ...

    The question behind is the following : when developing an INTRADAY trading system for the ES based on 3,5 or 15 minutes candles, what period should we use as "in sample data" ? ie what should we keep later "out of the sample" testing ?

    Personally, I am targeting a 3 min candle system producing between 1 and 3 signals per day, with 50% of winners and an average initial stop loss around 3-4 pt, and I am using as reference sample about one year of data (ie from Jan 02 right now).. I consider this period to be long enough so that I do not make any curve fitting. I mean : having an exit at market close (so i get about 500 trades in my backtest), my trades P/L distribution (resulting from the system parameter choice) is not too much influenced by the optimisation around some "big winners"... (ie i try to get a kurtosis as low as possible while keeping a positive skew..)
    Then I will test the resulting system on the previous ES years (01, 00, 99, 98) : I will be more concerned with the system performance in 2001 than in 98 because I really got the impression that the 98 ES market characteristics (volume / price spike) are quite "far" from the current conditions. I will check as well the system performance on NQ and YM for 01 and 02...

    In fact, when you want to test the performance of your intraday trading system, one may either try:
    *) to backtest on the same instrument as far as data are available (ie 97 for ES, but 82 if using SP data)
    *) to use (when possible) the same rules on other ETF/indexes and/or stock or commodities...

    So if there are some ES system trading developer around (using 3 / 5 / 15 min candles), i was wondering :
    1) what time period do you use for reference when developing your system and how far are you going back for out of sample testing ?
    2) if possible, are you testing the same system as well on big cap stocks, indexes or commodities in order to evaluate further its performance ?


    Thanks for the feedback

    Eddy
     
    #40     Feb 19, 2003