[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EasyLanguage for "First hour high/low"



PureBytes Links

Trading Reference Links

Thanks Stuart!

I'm obviously about to show how perfectly new to EasyLanguage I am.

I've read the Reference manual (download) and the intro guide, and I have
some limited understanding of how it discerns the series data.

I think my problem stems from variable scoping questions: for example, why
does count not get set to zero at each invocation of this function?

I understand it scans bars oldest to newest, and when the "Autoscan" feature
is on, it can figure out in RadarScreen exactly how many bars are needed to
scan (determine MaxBarsBack).

Assuming the example works (and I have not tested it but have no reason to
doubt it), this indicates that count (ant hence the rest of the vars) would
be initialized only once when the indicator is started, but not for each
bar. This works fine for a TradeStation indicator, certainly, as if you have
enough bars, it will eventually get a count > 13, and voila, you're happy.

However, in RadarScreen, it only scans the fewest number of bars possible.
To me, it looks like this will always be one bar (maybe two?), since the
greatest ofset is [1]. How would it know to start the scan sufficiently far
back to get at least to the start of the day? Does it keep scaning back
until there's no reference to the code with [1] in it? But there always is,
as the if statement always evaluates date[1].

So, I am obviously not understanding something, and your indulgence is
greatly appreciated if you could inform me.

Finally, I assume it's possible to determine the actual number of minutes
the bars are currently set to simply by referencing the code for the "Data
Compression" indicator, thereby making it possible to code in "1 hour" and
have it determine how high count can look.

One more question: Is it possible to determine in EasyLanguage what indices
a stock is in? For example, to be able to set an indicator true given a
single security (e.g. IBM) such that:

1) The security is up from yesterday's close
2) The security's sector is up (lookup that security's sector index)
3) The market is up (S&P is up or possibly Ru2k, etc, depending on which
one)

Many thanks,

Doug

----- Original Message -----
From: Stuart Lynskey <slynskey@xxxxxxxxxxx>
To: <dfields@xxxxxxxxxxxxx>; <omega-list@xxxxxxxxxx>
Sent: Tuesday, September 12, 2000 8:33 AM
Subject: Re: EasyLanguage for "First hour high/low"


> Hi Doug
>
> Omega has a number of built in functions for establishing session start
time
> and the like and manipulating time - personally I find it easier to do the
> whole thing manually and based on a count for the number of bars with
resets
> based on start of day.Thus something like this should get you going :
>
> vars:count(0),yesterdayclose(0),op(0),holdhigh(0),holdlow(0) ;
>
> { reset everything for new day }
> if date <> date[1] then begin
> yesterdayclose = close[1] ; { capture yesterdays close }
> count = 0 ;                 { reset count }
> op = open ;                 { capture open }
> holdhigh = high ;           { grab opening high }
> holdlow = Low ;             { grab opening low }
> end ;
> count = count + 1 ;  { count number of bars }
>
> { number for count - depends on your timeframe ...so if using 5 minute
bars
> and want the first hour trading set below to 13 - need to adjust on
> timeframe / time required obviously }
>
> if count < 13 then begin
> if high > holdhigh then begin
> holdhigh = high ;
> end ;
> if low < holdlow then begin
> holdlow = low ;
> end ;
> end ;
>
> Then for your true/false switch you would have something like :
>
> vars:outside(false) ;
> outside = false ;
> if count >= 13 and ( high > holdhigh or low < holdlow ) then begin
> outside = true ;
> end ;