EasyLanguage Question

Discussion in 'Trading Software' started by tdefarlo, Apr 26, 2002.

  1. Kymar

    Kymar

    Thanks for pointing out the exception, which is not very well covered in the EL documentation, as far as I can tell. I knew you could write "next bar on open" orders, but I didn't know that you could add or subtract from the next bar's open. Learn something every day...

    My point about EL not knowing on the current bar what the levels will be on the next bar is still generally valid, and I do still find it helpful to think of EL as establishing triggers at the end of each current bar for possible execution on subsequent bars. You can write a trading a signal, as in your example, that will utilize the "next" open (or, as you point out, date or time). You can't write a signal that operates within the next bar as some if/then condition or other event (a level being "crossed") is resolved. If you use a Moving Average as a stop, for instance, it sets the stop at the value of MA at the close of the bar, rather than "waiting" to see what the value of the MA becomes over the course of the new bar's development - even though you can see the indicator updating in realtime to different values.

    Even using the "next open" exception, you will encounter complications relating to the whole tick resolution/bouncing ticks issue. The long side of the signal that was being discussed might look like this:

    *********************************

    {Long Entry}
    Buy Next Bar at Open of Next Bar + 0.2 Stop;

    {1st Bar/"Stand By" Exits}
    If MarketPosition = 0 then Sell ("1Prof") Next Bar at Open Next Bar + .4 Limit;
    If MarketPosition = 0 then Sell ("1Stop") Next Bar at Open Next Bar Stop;

    {Subsequent bar Exits}
    If MarketPosition = 1 then Sell ("Prof") Next Bar at EntryPrice + .2 Limit;
    If MarketPosition = 1 then Sell ("Stop") Next Bar at EntryPrice - .2 Stop;

    ***************************

    If you put that on a 5-minute chart under the default resolution, you'll get a very different result than if you use 1-minute resolution, and yet a different result if you apply it in real time trading (which is tick by tick).

    If you add:

    SELL ("AVGX") next bar at Average(L,5) stop;

    And also plot an MA of the Lows and input 5 for length, you'll see the differences also.
     
    #51     May 25, 2002
  2. Kymar

    Kymar

    This thread has turned into a way for those us still learning about EL to compare notes and help each other out. There's been a lot of discussion of TS on this site, as well as reviews of the brokerage and the software. I suggest you search for the material and read through it. My own position will be obvious, as I've participated in a lot of the discussion, and have written reviews.

    If you're satisfied with "canned" indicators (like the MAs, Stochastics, trendlines, etc., available with most platforms) and relatively limited chart-customization features, and have no interest in system trading or testing, then you can use TS without learning much about EasyLanguage at all. You also don't necessarily need to learn EL to avail yourself of code written by third parties.
     
    #52     May 25, 2002
  3. Snosur4

    Snosur4

    I am having trouble writing a code to test a system.
    Can anyone help?

    What I want to do is:

    Buy if the price breaks out above the high of the first 30 minutes after the opening of regular trading.

    Sell if the price breaks below the low of the first 30 minutes.

    Placing stops at the high/low of the 30 min range.

    Close position at market close.

    Thanks in advance.

    snosur4
     
    #53     May 25, 2002
  4. Kymar

    Kymar

    Gee - no one else will answer the question, so y'all are leaving it to me again?

    Here's one way to do it:

    VARS: BBUY(0), SSELL(0), CUTOFF(0);

    CUTOFF = sess1starttime + 30;

    If time <= CUTOFF then begin
    BBUY = IDHIGH;
    SSELL = IDLOW;
    end;

    If time >= CUTOFF and time < sess1endtime then begin
    buy next bar at BBUY stop;
    sell short next bar at SSELL stop;
    end;

    {could also delete this section and instead combine
    signal with "close at end of day" signal}
    If time = sess1endtime then begin
    sell this bar on close;
    buy to cover this bar on close;
    end;


    This ought to work for testing purposes, but, if you introduced a profit stop or stop loss tighter than the 30 min low or high, you'd have to deal with re-buying and re-shorting, and add some kind of "flag" and probably a marketposition limitation.
     
    #54     May 26, 2002
  5. Snosur4

    Snosur4

    Thanks Kymar,

    everything seems ok except IDHIGH and IDLOW.

    It won't verify that command and I can't find it in the EL Dictionary.

    I think they should name it NOT so Easy Language.

    Snosur4
     
    #55     May 27, 2002
  6. as kymar told, noone was going to help, i will at least support kymar a bit ;-)

    IDHIGH stands for Intraday High. i have also never used this command, but kymar does, so im sure it works.

    try HIGHD(0) / LOWD(0) it works fine and is documentated.

    but remember kymars code for recognizing the first 30 min !!!

    best regards (also to kymar :) )

    lippi
     
    #56     May 27, 2002
  7. sorry, ppl.
    this is just a test for replying a post.
    i had errors while posting last message and want to find out,
    if my new firewall is responsible for that
     
    #57     May 27, 2002
  8. Kymar

    Kymar

    Hmmm... I believe the IDHIGH and IDLOW functions come with versions of TS6. If you're using TS6, you might want to check under functions and see if they're present. If not, I don't know why not... If you're using 2000i or something earlier, or in any event don't have the functions, you might want to refer to earlier discussion on this board about identifying the intraday high or low. Once you've assigned variables to whatever the intraday highs or lows are at the cutoff, they become your buy and sell stops. All the rest is basic syntax.

    By the way - and maybe it shows why trying to answer these questions can be a useful exercise (that I highly recommend) - in working out that code, I noticed an aspect of the IDHIGH/IDLOW functions that I neglected before: It seems that they have to be allowed to reiterate on every bar, so can't be bracketed within a single time cue. In other words, when you write the 30 minute breakout signal with TIME = CUTOFF rather than TIME <= CUTOFF (an "=" (equals) rather than a "<=" (is less than or equal to) ), things don't work. The code I scraped up earlier, a few pages ago, for a previous day high/low breakout signal may have to be checked with this problem in mind.
     
    #58     May 27, 2002
  9. hi,
    i use ts6 and im afraid a lot do.
     
    #59     May 27, 2002
  10. Kymar

    Kymar

    The hardcore programmer types find it woefully limited and simplistic. Can't satisfy everyone.

    As a total amateur when it comes to programming, I find EL kind of fun, and, so far at least, more than adequate for my trading purposes - though I do wish they'd integrate it further with the Order Bar and Account Manager... so you could call any order type from within EL (especially Stop Limit, but others including routing options and advanced features as well), and also so you could run any EL stop off any REAL entry.
     
    #60     May 27, 2002