Tradestation Easylanguage

Discussion in 'Automated Trading' started by tampatrader82, Apr 4, 2008.

  1. Does anyone have a basic outlay for the following:

    If current bar hits new hi for the last X bars and closes below the close of the last bar, then buy the stock at the close of current bar (or open of next).

    I am not a huge programmer and just looking for a basic set up so I can begin to tinker around...looking at a blank easy language screen is pretty overwhelming. Thanks in advanced.

    TPA
     
  2. Condition1 = (H = Highest(H, X));
    Condition2 = (C < C[1]);

    If (Condition1 and Condition2) = True Then
    Buy ("Buy Order") This Bar on Close;




    Hope this helps.

    RT
     
    MarkBrown likes this.
  3. Tums

    Tums

    TS comes with 100+ strategies in the program.

    Just open one up and start from there.

    All the Buy/Sell routines are already written, there is no need to reinvent the wheel.

    If you want to try some experiments, I would be happy to chip in.
     
  4. Tums

    Tums

  5. Here, I made this basic strategy for you.

    Input : barsback(4);
    Input : s (100), p( 100);

    setstoploss(s);
    setprofittarget (p);

    Condition1 = (H = Highest(H, barsback));
    Condition2 = (C < C[1]);

    If (Condition1 and Condition2) = True Then
    Buy ("Buy Order") This Bar on Close;

    It's bad but it's what you asked.

    Hope it serves you well.

    Susana
     
    MarkBrown likes this.
  6. Thank everyone for the input. I gave an example just to get started. I bought the T-station basics to easy language and have been using it.

    My strategies are solid and do work (the one i gave you obviously wasn't one, but i needed something to start with. (Im secretive about strategies (kind of dumb I know, but oh well). I have good insight, just bad back testing ability due to lack of comp sci knowledge.



    Once I figure out darn easy language I'll be happy. I should have majored in comp sci instead of econ back in the day :).

    Thanks again, anyone interested in potentially building a strategy? I figure my input and easy language knowledge from someone else, could end up being a profitable team.

    TPA
     
  7. greene828

    greene828

    Can anyone clarify? For easylanguage, if I reference Close[0] in a line of code, does this calculate as the bar is forming or only at the close of the bar?

    Is close[0] the last closed bar or the current bar that is forming?

    thanks
     
  8. schizo

    schizo

    Close of the current bar or the open of the next bar.
     
  9. greene828

    greene828

    Ok thanks. I wish TS had heiken ashi candles built in