Tradestation - Please Help!

Discussion in 'Trading Software' started by J-S, Sep 18, 2002.

  1. m_c_a98

    m_c_a98

    Did you go through the entire HELP manual that is in the program? Did you read the printed manual?
     
    #11     Sep 18, 2002
  2. J-S

    J-S

    "Hmmm, that's odd. This may sound like a dumb question, but did you verify the signal? I just created a quick test signal and as soon as I verified it, I had access to it in the strategy builder's list of signals."

    Thanks war eagle - you hit the nail right on the head.

    It's telling me that 'matching left comment brace '{' is missing.

    The code is the Turtle system, and was kindly posted to me by WD Gann. I'm not sure what to do with this bracket, and whether it is part of the system. I have pasted the code below - is anyone able to help me? Would deleting this brace ruin the system? (the brace is 12 lines from the bottom)

    Many thanks

    Jo

    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;
     
    #12     Sep 18, 2002
  3. I couldn't find your missing bracket. I know TS6 will show you where it is missing. I'm guessing 2000i doesn't do that for you?
     
    #13     Sep 18, 2002
  4. J-S

    J-S

    Hi Tyler - Its the one 3 lines up on the bit I pasted below (End;})

    I haven't got a clue what } means, and whether it needs to even be there in this context - can you help?

    Thanks a lot

    Jo


    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);
     
    #14     Sep 18, 2002
  5. looks like you should delete it. Those brackets are used to insert comments that aren't read by easy language.
     
    #15     Sep 18, 2002
  6. WarEagle

    WarEagle Moderator

    Glad you found the problem. Tyler is right.
     
    #16     Sep 18, 2002