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

Re: Weekly Indicators based on Daily data



PureBytes Links

Trading Reference Links

> If you write your own function that doesn't require access to
> previous bar values -- which requires a Series function -- then
> you can declare it to be a Simple function.  Then, when you call
> it on Fridays, it is really only called on Fridays, and you'll get
> exactly the same results as if you called it on every bar of a
> weekly chart. 

I should have clarified something:  the above is true *IF* your 
function, like xaverage or RSI, only uses the value of the Close in 
its calculations.  The daily Close on Friday is the same as the 
weekly Close, so you can calculate the same values if you call the 
function right.

If your code uses Open, High, or Low, like e.g. ADX, then you won't 
get the right results if you only call it on the Friday bar.  Because 
then you'll be using the Open/High/Low of the Friday bar, not the 
weekly bar.

In that case you'd have to write a different function that gets 
called on every bar (so it could be a Series function if you wanted) 
and records the O/H/L/C during the week.  Then you'd use those weekly 
values of O/H/L/C for your calculations.

Gary