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

Counting the bars? Displaced MA figures?


  • To: omega-list@xxxxxxxxxx
  • Subject: Counting the bars? Displaced MA figures?
  • From: Traktor Topaz <traktor@xxxxxxxxxxx>
  • Date: Tue, 17 Sep 2002 13:59:48 -0700
  • In-reply-to: <200209170149.SAA32329@xxxxxxxxxxxxxx>

PureBytes Links

Trading Reference Links


I've got two EasyLanguage things that, so far, have me stumped. Maybe you
can advise me:

puzzle #1 --

   I'm on bar number one, and I'm going to go through the bars calculating
some statistics. Before I start, I need to know about the
open/high/low/close of the last bar on the chart, and about the bar
immediately preceeding. That's because these things will tell me what it is
that I want to gather statistics about. 

   So how does one:

	a) count the number of bars (before going through the bars)? and
	b) access a future bar, that is Bar[-1026] for example?

   It is easy to displace a *plot* into the future, and TradeStation has
access to all the data, but I don't know how to get my hands on it.

puzzle #2 --

   In TradeStation one can easily calculate a 60-day Moving Average, and
the plot command will enable you to 'displace' the plot. For example, to
plot each MA value five days earlier.

   Because I want to work with these 'displaced' values rather than to plot
them, the question becomes: how can I, sitting on bar 259, calculate a
60-day moving average as of bar 266 backwards, so that the figure I have
today represents the usual MA value moved back in time by five days? (I've
tried averaging Price[-5] but it produces the wrong result.)

   I would be grateful for any guidance on how to approach these problems.

-- Arthur Cronos, Fairfax CA

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