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

Re: Multiple time frames



PureBytes Links

Trading Reference Links

Hi Stef,
Cw=ValueWhen(B<Ref(B,-1),Ref(Close,-1));
gives every Monday (or every first working day of the week) the 
close value for last Friday (or the last working day of previous week)
and keeps this value till the end of the week.
As for Hw and Lw is quite different from the question.
Try to plot them and you will see.
Dimitris Tsokakis
--- In amibroker@xxxx, "nenapacwanfr" <nenapacwanfr@xxxx> wrote:
> HI,
> Do you think this could do the job
> 
> steph
> 
> /***Weekly Bars***/
> B=DayOfWeek();
> G=BarsSince(B<Ref(B,-1));
> 
> Hw=ValueWhen(B<Ref(B,-1),HHV(Ref(H,-1) ,Ref(G,-1)+1));
> Lw=ValueWhen(B<Ref(B,-1),LLV(Ref(L,-1) ,Ref(G,-1)+1));
> Cw=ValueWhen(B<Ref(B,-1),Ref(Close,-1));
> 
> Graph0=Close;
> Graph0Color=1 ;
> Graph0Style=64;
> 
> Graph1=CW;
> Graph1Color= 5 ;
> Graph1Style=1;
> 
> 
> I am currently working with some code with the WEEKDAY function to
> > determine the previous week start and end and proceed from there.
> > Thanks for the code though. Will come in handy for sure. 
> >