PureBytes Links
Trading Reference Links
|
This can make the code simpler
Cond=DateNum()==LastValue(Ref(DateNum(),-1));
H1=Cond*H;
Hmax=LastValue(Highest(H1));
Thanks
DT
--- In amibroker@xxxx, "dtsokakis" <TSOKAKIS@xxxx> wrote:
> I did not know that ref(Datenum(),-1) gives the previous TRADING
date.
> DT
> --- In amibroker@xxxx, "Sharps_45_70" <sharps_45_70@xxxx> wrote:
> > This seems to work.
> >
> > Ed
> >
> > /////// Drop into indicator builder///////
> >
> > x=BarsSince(DateNum()==Ref(DateNum(),-1));
> > y=BarsSince(DateNum()==Ref(DateNum(),-2));
> >
> >
> >
> > Hmax=Ref(HHV(H,x),-y);
> >
> > Graph0=H;
> > Graph1=Hmax;
> >
> > /////////////////////////////////////////
> >
> > ///Check in AA that ref(,-1) ignores weekend ///
> >
> > x=BarsSince(DateNum()==Ref(DateNum(),-1));//
> > y=BarsSince(DateNum()==Ref(DateNum(),-2));//
> >
> >
> >
> > Hmax=Ref(HHV(H,x),-y);
> >
> > Graph0=H;
> > Graph1=Hmax;
> >
> > Filter=DayOfWeek() == 1;
> > AddColumn( DateNum(), "DateNum", 1 );
> > AddColumn( Ref(DateNum(),-1), "DateNum", 1 );
> > /////////////////////////////////////////////
|