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

RE: How to init var values prior to CurrentBar = 1?



PureBytes Links

Trading Reference Links

Set maxbarsback to 20, then currentbar = 1 will start  at bar  21.
This is the reason why mbback exists.
You cannot initialize a 20 bars moving avaerage with less than  20 bars...

Sincerely,

Pierre Orphelin
www.sirtrade.com
Tradestation 2000i, TradeStation 7 sales and support
Safir-X, neurofuzzy logic trading system builder

To subscribe to our FREE trading system newsletter:
http://www.sirtrade.com/newsletter.htm




-----Message d'origine-----
De : Brendan B. Boerner [mailto:brendan@xxxxxxxxxxxxxx]
Envoyé : lundi 2 juin 2003 00:34
À : Omega-List
Objet : How to init var values prior to CurrentBar = 1?


Hello,

Suppose I want to average C e.g. value1 = Average(C, 20).  With
CurrentBar = 1 this works as I expect.

Suppose instead I want to copy C into a variable and average that e.g.

Value1 = C;
value2 = Average(Value1, 20);

(The reason I want to do this is to compute an average on a
transformation of C).

The problem is that this won't produce the results I expect until
CurrentBar = 20 because (using CurrentBar = 1 as reference) Value[20]
through Value[1] aren't initialized with C[20] through C[1] but
instead 0.

Does anyone have thoughts on how I can initialize these portions of
Value1?

Thanks in advance.

Regards,
Brendan