Turtle System into Tradestation

Discussion in 'Strategy Building' started by J-S, Aug 30, 2002.

  1. Stocks and Commodities Mag published the turtle rules and EL code for currency trading a couple of years ago.

    Have a look at these links

    http://store.traders.com/v19836tradtu.html

    http://store.traders.com/v1554quicsca.html

    the code is very simple

    long - high greater than the high of last 20 days (bars)

    exit - low lower than the low of the last 10 days

    short - low lower than the low of the last 20 days

    exit - high greater than the high of the last 10 days.


    I'm led to believe it doesn't work very well in most markets and I've never encountered anyone thats made money with it.

    Some people recommend using a 40 day high, 20 low for less trades longer in the market.

    Runningbear
     
    #11     Sep 9, 2002
  2. I suspect to program it into TS2000 in EL would be easy but since
    turtle's premise is to pyramid into winners. Backtesting and using such a system would be hard.
    ...or should I say hard to verify if it works as promised....
     
    #12     Sep 11, 2002
  3. Here's the code. But remember... Turtle trading can't be done completely with codes. There's a lot more to do than what is down here but it does make the process easier. Code is written by me so use all you like:




    Variable: ATR(0), Acct(0), MaxAcct(0), DDown(0), Risk(0), Risk2(0), Contr(0);

    ATR = AvgTrueRange(15);

    Acct = 100000 + NetProfit; {This is the account size you want to put in}
    If Acct > MaxAcct then MaxAcct = Acct;
    If MaxAcct > 1 then DDown = Acct / MaxAcct;
    Risk = Acct * .02;{Per trade risk by Decimal}
    Risk2 = Risk;

    {Risk of Ruin}
    If DDown <= 0.9 and DDown > 0.8 then Risk2 = Risk2 * 0.8;
    If DDown <= 0.8 and DDown > 0.7 then Risk2 = Risk2 * 0.64;
    If DDown <= 0.7 and DDown > 0.75 then Risk2 = Risk2 * 0.5;
    If DDown <= 0.75 and DDown > 0.6 then Risk2 = Risk2 * 0.4;
    If DDown <= 0.6 and DDown > 0.5 then Risk2 = Risk2 * 0.32;
    If DDown <= 0.5 then Begin;
    Alert("Busted!!");
    Risk2 = 0;
    End;

    Contr = Risk2 / ((2 * ATR) * BigPointValue);

    {Entry}

    Variable: PLFactor(-1), InitContr(0), InitATR(0), LongFS(-1), ShortFS(-1);

    Condition1 = CurrentBar > 0 and High > HighestFC(High, 20)[1];
    Condition2 = CurrentBar > 0 and Low < LowestFC(Low, 20)[1];

    If PositionProfit > 0 then PLFactor = 1;
    If PositionProfit < 0 then PLFactor = -1;

    If MarketPosition <= 0 and Condition1 and LongFS = -1 Then Begin;
    If PLFactor = -1 then Begin;
    Buy("L-Entry") Contr Contracts at Close + 1 Point Stop;
    InitContr = Contr;
    InitATR = ATR;
    ShortFS = -1;
    End;
    If PLFactor = 1 then Begin;
    ShortFS = -1;
    LongFS = 1;
    PLFactor = -1;
    End;
    End;

    If MarketPosition >= 0 and Condition2 and ShortFS = -1 Then Begin;
    If PLFactor = -1 then Begin;
    Sell("S-Entry") Contr Contracts at Close - 1 Point Stop;
    InitContr = Contr;
    InitATR = ATR;
    LongFS = -1;
    End;
    If PLFactor = 1 then Begin;
    LongFS = -1;
    ShortFS = 1;
    PLFactor = -1;
    End;
    End;

    Condition8 = CurrentBar > 0 and High > HighestFC(High, 50)[1];
    Condition9 = CurrentBar > 0 and Low < LowestFC(Low, 50)[1];

    If MarketPosition <= 0 and LongFS = 1 and Condition8 then Begin;
    Buy("L-Entry-FS") Contr Contracts at Close + 1 Point Stop;
    InitContr = Contr;
    InitATR = ATR;
    LongFS = -1;
    End;

    If MarketPosition >= 0 and ShortFS = 1 and Condition9 then Begin;;
    Sell("S-Entry-FS") Contr Contracts at Close - 1 Point Stop;
    InitContr = Contr;
    InitATR = ATR;
    ShortFS = -1;
    End;

    {Pyramid}

    Condition3 = MarketPosition = 1 and CurrentBar > 0 and High > Highest(High, 50)[1];
    Condition4 = Marketposition = -1 and CurrentBar > 0 and Low < Lowest(Low, 50)[1];

    Condition5 = ATR < (InitATR * 6);
    Condition6 = CurrentEntries <= 1;

    Condition7 = OpenPositionProfit >= (CurrentEntries * (InitATR * 0.5) * BigPointValue);

    If Condition4 and Condition5 and Condition6 and Condition7 then Begin;
    If Contr < InitContr then Sell("S-Pyramid") Contr Contracts at EntryPrice(0) - ((InitATR * 0.5)-1 Point) Stop
    Else Sell("S-Pyramid.") InitContr Contracts at EntryPrice(1) - ((InitATR * 0.5)- 1 Point) Stop;
    End;}

    {Stops}

    Variable:pyraCont(0);

    If CurrentEntries > 0 then PyraCont = CurrentContracts / CurrentEntries;

    If CurrentEntries = 1 then ExitLong("2 ATR EL") at EntryPrice(0) - (InitATR * 2) Stop;
    If CurrentEntries = 1 then ExitShort("2 ATR ES") at EntryPrice(0) + (InitATR * 2) Stop;

    If Low < LowestFC(Low, 10)[1] then ExitLong("Rev BrkOut EL") at Close - 1 Point Stop;
    If High > HighestFC(High, 10)[1] then ExitShort("Rev BrkOut ES") at Close + 1 Point Stop;

    ExitLong("RangeStop EL") LowestFC(Low, 10) - 1 Point Stop;
    ExitShort("RangeStop ES") Highest(High, 10) + 1 Point Stop;

    If CurrentEntries <= 1 and OpenPositionProfit < 0 and BarsSinceEntry(0) >= 10 then ExitLong("10 day EL") at Open;
    If CurrentEntries <= 1 and OpenPositionProfit < 0 and BarsSinceEntry(0) >= 10 then ExitShort("10 day ES") at Open;
     
    #13     Sep 11, 2002
    Shax likes this.
  4. OK, I've taken out some of my extra own criterias out of there so it coding has some extra stuff but I think I left the main, codable things in there.

    One thing to remember is pyramiding isn't the key. A lot of people who talk about Turtle Trading says pyramiding is how they make money but the truth is it's not. One of the key points are diversification. I can make 30%+ with purely using the Turtle system signals without pyramiding, with diverisifying. It seems like pyramiding is the key when they test the system on Tradestation, which can only test one symbol at a time. (I can code in WealthLab)

    So all the new Turtle people beware about people who says Turtletrading is all about pyramiding. They've only read materials from Turtletrader.com, who does not have or explain the whole Turtle system very well completely. I have their material and the other materials. I've got a friend who, worked with (under) Bill Eckhart and Rich Dennis, agrees about Turtletrading.com not being a sufficient material. He says Russell Sand's course(the expensive one, $1000+) is more complete. $200 one is not well explained too.
     
    #14     Sep 11, 2002
  5. WD Gann,

    Your contribution is a surprise. I actually know you personally so it doesn't matter. You seem to be on the right point.

    J-S,

    Did you test the system? Since you have the code already I wonder what your impression are about the Turtle System.



    trend456:D
     
    #15     Sep 11, 2002
  6. Glitch

    Glitch

    #16     Sep 12, 2002
  7. J-Law

    J-Law

    You still need to figure the "how much"question in proportion to your account.

    Entries and exits are just that. Entries and Exits.

    What about the risk ??? That's when the system takes on a 3-D perspective.

    I bought the system a few years back. The text was in great need of editing. Too much information and not well organized. But they are on to something.

    The trading premises looks sound. There is a section on trading with a positive expectency, which is the whole crux of making money in trading. It was a useful yet, an expensive read.

    As far as programming goes, they offer NO HELP whatsoever . This was a problem considering I was still attempting to learn how to get a Excel SS spit out an ATR.

    I like the style of trading. Big money is made in the big moves. No doubt about it.
     
    #17     Sep 12, 2002
  8. Turtle System just can't be coded... it's more a concept than a system. At least with a system back-testing... whether it's with WealthLab, TS2000i, or other software(addons), they tell you you' ve some statistical edge in it.
     
    #18     Sep 12, 2002
  9. J-S

    J-S

    Hi trend

    I've not had a chance to test it across a broad range of markets as I'm still searching for a reliable source of end of day data to feed into Tradestation 200oi.

    I wonder whether anyone is able to help me with this? I'm considering using esignal end of day with dynastore acting as 3rd party. Has anyone used this option, and if so is it reliable?

    Thanks

    JO
     
    #19     Sep 12, 2002