70% winning break out system for ES

Discussion in 'Index Futures' started by piggie, Aug 20, 2006.

  1. piggie

    piggie

    I found the following code posted by a well respected ET member who no longer wishes to participate on the ET forum. Huge loss for the forum in my opinion.

    It is written in TS Easy Language, which I am not familiar with. Would someone that knows TS translate the code into plain English? Thank you.

    Or specifically, what are meanings of the following expression or functions?

    date <> date[1] ( today's day not day 1 of the week or month?)

    dayofweekfix

    highd (high of the day ?)
    high[1] (high of the first day this week ? month?)

    what's the time frame of the bar here? (week?)

    ----------------------------
    variables:
    hh(0),ll(0),tgt(0);

    if date <> date[1] then
    begin
    if dayofweekfix(date) = 1 then
    begin
    hh = 0; ll = 99999;
    end;
    tgt = (highd(1) - lowd(1) + highd(2) - lowd(2) +
    highd(3) - lowd(3))/15;
    end;

    if high[1] > hh then hh = high[1];
    if low[1] < ll then ll = low[1];
    if adx(14) > 25 then
    begin
    sell 1 contract next bar at hh limit;
    buy 1 contract next bar at ll limit;
    end;

    exitlong at hh + tgt limit;
    exitshort at ll - tgt limit;
     
  2. Here you go Piggie. This strategy should work on intraday bars. By the way, DayOfWeekFix() seems to be a modified version of DayOfWeek().

    HighD(1) is the high of one day ago (i.e., yesterday's high), similar for LowD(1).

    // declare variables for highest high, lowest low, and target
    // hh will hold the highest high for the week and ll will hold the
    // lowest low for the week. Every Monday these variables get
    // initialized. Price trading to hh or ll will indicate a breakout.
    // See below for target.
    variables:
    hh(0), ll(0), tgt(0);

    // if this is the first bar of a new day...
    if date <> date[1] then
    begin
    // if this is Monday...
    if dayofweekfix(date) = 1 then
    begin
    // initialize highest high and lowest low
    hh = 0; ll = 99999;
    end;

    // calculate the target for the trade by adding the range of
    // the previous 3 days and dividing by 15
    // tgt is target for where the trade is exited
    tgt = (highd(1) - lowd(1) + highd(2) - lowd(2) + highd(3) - lowd(3))/15;
    end;

    // if yesterday's high is greater than the current highest high,
    // then set the highest high to yesterday's high
    if high[1] > hh then hh = high[1];

    // if yesterday's low is less than the current lowest low, then set
    // the lowest low to yesterday's low
    if low[1] < ll then ll = low[1];

    // if the 14-period ADX is greater than 25 (checking for trending),
    // then buy or sell a contract
    if adx(14) > 25 then
    begin
    // buy or sell if breakout occurs
    sell 1 contract next bar at hh limit;
    buy1 contract next bar at ll limit;
    end;

    // exit trade when the target is reached
    exitlong at hh + tgt limit;
    exitshort at ll - tgt limit;
     
  3. What's the exit, other than hitting the profit target?

    Is there a stop (fixed or trailing), or just exit at the close (if this only takes day-trades)?

    Or does it hold a position (overnight, if needed) until either the profit target is hit, or an opposite signal comes up?

    If the latter is the case, then even if it has a 70% win rate, the risk to reward ratio would certainly cause this system to have a negative expectation.
     
  4. joesan

    joesan

    70% winning rate ?

    I am very doubtful
     
  5. With no stops, it's very possible to get a hit rate that high. The problem is how big are the losers compared with the winners?

    If you're betting 10R (where R is your max risk) to win 1R and you do it 70% of the time, you have to understand you'll give back 10 days of winnings sometimes.

    The name of the game is expectancy, not hit rate.
     
  6. You hit the nail on the head. I looked at this strategy in TradeStation. It does have about a 75% win rate, but avg winning trade==1/3 avg losing trade! Positive expectancy... but not very positive.
     
  7. On your backtest, what did you use for exit when profit target not hit - MOC? Or did you hold (overnight if necessary) until either PT hit or contra signal given?
     
  8. I used the code as is. No stops, holds overnight until profit target is hit. I didn't even test it with a stop because I can see what the outcome is gonna be.
     
  9. es175

    es175

    Hi there,

    Please forgive my ignorance of TradeStation. Maybe someone could answer a couple of points I'm not clear on.

    1.
    The orignal post that accompanied this strategy specifies that 5 minute bars are to be used.
    http://www.elitetrader.com/vb/showthread.php?s=&postid=1053552&highlight=acrary+jason#post1053552
    In his explanantion to piggie, HispaTrader makes the following comments on the code:

    "// if yesterday's high is greater than the current highest high,
    // then set the highest high to yesterday's high
    if high[1] > hh then hh = high[1]; "

    HispaTrader therefore implies that high[1] refers to DAILY bars as opposed to 5MIN bars. Is this correct? Is the code returning yesterday's high or the previous 5 minute bar's high? I note that the code in question is high[1], not highd(1).

    2.
    Given that there is no explicit stop in the code, under what circumstances does a losing trade close out? Should one assume a MOC in TradeStation coded systems or is there a better explanation?

    Any help would be much appreciated.

    Thanks,
    es175
     
  10. Having written a number of very similar systems myself, I image the following to be highly probable:

    #1: Any attempt to use stops and/or trailed stops will diminish overall results. The "always in" aspect is designed to catch & hold big winners... many of which emerge from deep in the hole against initial entry.

    #2: It will have deep historical drawdowns. The sideways periods of chop tend to kill such systems... large strings of small losses (and a few big ones) equal very painful drawdowns.

    Be very careful if/when working with systems like that. Use at least three years of data backward, and running monte carlo risk of ruin projections is critical, too. Mix up the sequence of trades that history recorded per the system parameters, you might find it totally falls apart.

    Hope this helps
    Austin
     
    #10     Sep 27, 2006