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

Re: Question on calculation



PureBytes Links

Trading Reference Links

Guy,

Unless I've missed something, it sounds as if you should be using the
Reference function:  ref(DATA_ARRAY, PERIODS).  With P representing your
variable, you could have Ref(P, -1), Ref(P, -2), ... Ref(P, -18).  Each
time you do a data update the variables would be bumped along the chain.

The Prev function is slow and its use should be kept to a minimum.

HHP
==================

Guy Tann wrote:
> 
> List,
> 
> Well I'm in the process of trying to move our Intermediate Term Signals into
> MetaStock and need a little help.
> 
> First, here are a few of my assumptions I made after reviewing the latest
> manual (v7.01).
> 
> 1. Variables go away after each day (we're EOD traders, so daily is our time
> frame).
> 2. The only way you can reference a prior day's value is by using PREV or by
> plotting the indicator and using the "P" Data Array Identifier.
> 3. The only way to reference the previous 20 values of an indicator is by
> using the "P" Data Array Identifier.
> 4. Plotting of indicators is irrelevant for our system, so I'm only
> interested in a programming solution.
> 
> Questions:
> 
> 1. Is there any way to build an array or list of variables that you can
> programmatically control?  For instance, I want to maintain the last 20
> values of a specific indicator and keep them for use on the next day.  At
> then end of each days processing, I would move X17 to X18, thereby dropping
> the previous X18.  X16 to X17, etc., thereby getting ready for the next days
> result, which I would store in X.
> 2. Is there any way that I can maintain multiple PREV values for an
> indicator?  What about PREV -1 and PREV -2?
> 
> In our Intermediate Term System, we have an indicator we calculate whereby
> we maintain the last 18 results, always keeping the last 18 values available
> to us for calculations.  We use the first 6 for a short-term indicator, the
> second six for an intermediate-term indicator and the final six for a
> long-term indicator.
> 
> I'm trying to avoid having to do much additional programming outside of
> MetaStock, if possible, so I would appreciate any assistance.  Does anyone
> know of an add-in that's available that would provide array or table
> capabilities to MetaStock?
> 
> Thanks for any help.
> 
> Guy
> 
> Paranoia...you only have to be right once to make it all worthwhile!