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

Re: On the first bar, how to access the last bar?



PureBytes Links

Trading Reference Links

Instead of accessing the last bar from the first bar, why don't you access
the first bar from the last bar?  Easy Langugage contains a "for" statement
which can be used to loop across past bars.

Kent


----- Original Message -----
From: "Traktor Topaz" <traktor@xxxxxxxxxxx>
To: <omega-list@xxxxxxxxxx>
Sent: Tuesday, September 17, 2002 10:26 AM
Subject: On the first bar, how to access the last bar?



   This is probably simple, but it's eluded me so far:

   I wish to go through the bars of a given contract, performing some
statistical calculations, looking to see how often something happens. But
before I run through the bars I need to know one simple thing about the
last and next-to-last bars.

   As a (simplified) example, let's say that today (the last bar on the
chart) the open is so-much higher/lower than yesterday's open, and now I
want to run through all the bars and count up how often that is the case.
So I'd like code like this:

   If currentbar > 1 then begin

OpenPosition = Open[lastdayonchart] - Open[nexttolastdayonchart];

if open[today] blah-blah open[yesterday] then add-some-stuff-up.

if lastbaronchart then plot1( results, 'results' );

   end;

   The part that's eluded me so far is how, on the first (or second) bar of
the chart to find out how many bars  exist in this chart so as to access
the last-bar and next-to-last-bar on the chart.

   Can someone point me at the answer?

-- Arthur Cronos, Fairfax California

PS: Does anybody else find the TS 'help' system for looking up commands to
be inferior to a printed book which organizes similar commands together?
Does anyone else think that for $95 a month, those folks could send a
printed book?



_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
         MOBIUS MEGATAR TAPPING BASSES
'Making Music Easier'   http://www.megatar.com
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/