Weekly has fewer bars than daily, but ends at the last bar, so you
have to start calculating from the first bar in the weekly array, not
i=1; but i=firstbar;
firstBar can be calculated, or you can start at 1, but ignore all
null data at the beginning of the array:
function calcu(array)
{
for (i=1; i<BarCount;i++)
{
if(array[i] != Null)
{
...........
}
}
}
On Oct 30, 2007, at 12:06 PM, wonet2001 wrote:
> there is a function in my code like this:
>
> function calcu(array)
> {
> for (i=1; i<BarCount;i++)
> {
> ...........
> }
> }
>
> in regular code. I call this function after timeframeset to different
> timeframe, and I have trouble, database is in daily
>
> timefrmaeset(inWeekly);
> wvalue = calcu(C);
> timeframerestore();
>
> dvalue = calcu(C);
>
> plot(dvalue .....)
>
> plot(wvalue .....)
>
> dvalue plot correctly, but wvalue is totally wrong.
>
> using debugview, check the Barcount, they are the same value. how to
> correct it?
>
>