Stop Limit in Tradestation

Discussion in 'Automated Trading' started by TheStudent, Sep 29, 2005.

  1. Hi,

    Does anyone know the EasyLanguage code for placing a Stop Limit in Tradestation?

    Let's say you want the computer to place a 110 stop limit order to buy when spot is 100 - how do you do that?

    I know the code for a buy stop is

    "Buy next bar 1 contract at 110 stop;"

    Anyone with the answer?
  2. 65Matt


  3. I don't remember the code perfectly, it's bit lengthy.
    But i have it, will send to you later today
  4. nana,

    thanks so much.

    I've given up using automated stop entries because I get such bad execution in YM ... gone back to the stone age for now.
  5. Not sure still you want it , incase need it later

    Vars:ONBlimit(false), ONBstop(false), ONBlimit2(false),
    ONBstop2(false), ONBlimitvalue(0), ONBstopvalue(0);

    ONBlimitvalue=High+4 points; {Replace with your own point values}
    ONBstopvalue=High+2 points; {Replace with your own point values}

    ONBlimit= Open of next Bar >= ONBlimitvalue;
    ONBstop= Open of next Bar<= ONBstopvlaue;
    ONBlimit2= Open of next Bar <= ONBlimitvalue;
    ONBstop2= Open of next Bar>= ONBstopvlaue;

    If ONBlimit then buy next bar at ONBlimitvalue limit
    else If ONBstop then buy next bar at ONBstopvlaue stop
    else if ONBlimit2 and ONBstop2 then buy next bar at market;

    Above is stop limit order for Buy order, also same for Buytocover
    orders (just replace exit short with the word "buy").

    For short and sell order, everything opposite.