EasyLanguage Question

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


  1. Yes you can do it but it will require outside program help (TS doesn't natively do this). Use a global variables package to do this (not an easy road). But I have to ask if it will be worth it to go to all the trouble for a study based off of stochastics?

    Another approach that may / may not work might be to cleverly take the stochastic formula apart. Feed in the current value from data1 (intraday) into the formula after getting the past value off from data2 (daily).

    Good Luck!
     
    #21     Apr 30, 2002
  2. tdefarlo

    tdefarlo

    Wow, I am surprised TS can't do something so simple! You are right, it would not be worth it just to get the stochastic value, but the stochastic value is just one element of the equation. Your approach sounds as it will work though. Thanks much.
     
    #22     Apr 30, 2002
  3. the question has been answered a lot here, but why so complicate?

    variables: TodaysRange(0);

    TodaysRange=HighD(0)-LowD(0);





    looks easier, doesnt it

    lippi
     
    #23     Apr 30, 2002
  4. akhuto

    akhuto

    Hi,

    This thread has been very helpfull. I just got tradestation and I am going nuts. :)

    I have a question :

    Let's say I want to buy intraday as soon as it takes out the previous day's high .
    so ,is it possible to use data1 (daily chart) and data2(intraday chart) to build a strategy?

    so it would be :

    if c of data2 > high(1) of data1
    then buy next bar at close of data2 ;

    I tried that but it doesn't work.
    If there is another way please help me.
    thanks.
    Angela.
     
    #24     May 16, 2002
  5. tdefarlo

    tdefarlo

    I think you do not even need the daily data series. If data2 is intraday then you could try:

    If close of data2 > highd(1) then .....

    Because HighD refers to the previous day high and (1) looks back one day.

    Or you can try

    If close of data2 > High[1] of data1 then ....
     
    #25     May 16, 2002
  6. akhuto

    akhuto

    tdefarlo
    "I think you do not even need the daily data series. If data2 is intraday then you could try:

    If close of data2 > highd(1) then .....

    Because HighD refers to the previous day high and (1) looks back one day.

    Or you can try

    If close of data2 > High[1] of data1 then ...."



    I did that but when I inserted the strategy into the chart it still doesn't work .I dont' know if it's caused by whatever it's after "then.........."

    thanks
     
    #26     May 16, 2002
  7. hi all

    i really wonder that its possible to handle different datastreams within a certain strategy.
    i thought, the stream is defined by the chart: intraday(3min), intraday(5min), daily...

    could u explain to me, how u get informations about/as 'data1' or data2'

    found nothing about that, wether in el-book nor ol-help.

    to get yesterdays high is easy by using highd(1) if in a intraday chart
    (as long as the maxbarstostudy is set greater than the bars where used yesterday !!),
    and so i did.

    but use tick/intraday streaming datas in a daily chart?

    im confused, help me pls

    lippi
     
    #27     May 16, 2002
  8. Kymar

    Kymar

    Lippi,

    Look in the EASYLANGUAGE REFERENCE GUIDE (on-line or get the real book) index under "Data Streams, referencing."
     
    #28     May 16, 2002
  9. kymar,
    im so sorry :)

    i find that i cound reference to a datastream by using 'data(1)).

    i cant find explanation of (1) or (2)...
    i also do not find anything how to use data-commands in a strategy or whereever.

    i was sure, i understood EL right well.
    now im not :)

    so one more tip?
    maybe some code-examples how to use ?
    i will get the meaning fast by testing and handling debug-protocols.

    thx lippi
     
    #29     May 16, 2002
  10. Kymar

    Kymar

    There are lots of different ways to do this.

    Let's presume, for simplicity's sake, that you're just trading equities:

    VARS: PDHIGH(0);

    {IN CASE YOU WANT TO BUY ON FIRST BAR OF NEXT DAY}

    IF TIME = SESS1ENDTIME THEN begin
    PDHIGH = IDHIGH;
    BUY NEXT BAR AT PDHIGH STOP;
    End;

    {FOR ALL OTHER INSTANCES:}

    IF DATE <> DATE[1] then PDHIGH = IDHIGH[1];

    BUY NEXT BAR AT PDHIGH STOP;

    You might also want to review the earlier discussion of the range-related signal, as the code covers similar issues.

    As I said, there are other ways to do this, but ones involving multiple data streams are unnecessarily cumbersome, IMO.

    Anyway, that code will take you only so far: If it's not joined to an exit, then, depending upon how it's formatted, it'll either buy once and never buy again, or it'll constantly re-buy up to your position limits.

    There are of course, various techniques used to make things more practical/realistic. Unless you're intending to take one of the courses, hire a consultant, or purchase canned signals/indicators, or are unusually good at picking up programming languages on your own, I'd recommend that you get a copy of USING EASY LANGUAGE and go through it carefully before trying to write your own trading signals - or at least study the TS-included signals and available reference material in detail. I also found the disk of signals written for STREET SMARTS, available from TradersGalleria.com, very helpful as a study. I don't know if they've been specifically re-written for TS 6 (if not, would require some minor editing).

    Oh, and last, please pardon me if I made some mistake in the code above! If it doesn't work like I said it would, let me know, and I'll look it over again... (bit of a rush here)...
     
    #30     May 16, 2002