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

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


  • To: omega-list@xxxxxxxxxx
  • Subject: On the first bar, how to access the last bar?
  • From: Traktor Topaz <traktor@xxxxxxxxxxx>
  • Date: Tue, 17 Sep 2002 07:34:54 -0700
  • In-reply-to: <200209170149.SAA32329@xxxxxxxxxxxxxx>

PureBytes Links

Trading Reference Links


   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
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/