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

[amibroker] Re: Pivot Points



PureBytes Links

Trading Reference Links

--- In amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxx> wrote:
>
> Because the Friday may not always be the last market day of the
week, Use
> for the end of the week
> EndOfWeek = dayofweek()>ref(dayofweek(),1);
> It works. Thanks all.
> 
> -- 
> Cheers
> Graham
> AB-Write >< Professional AFL Writing Service
> Yes, I write AFL code to your requirements
> http://www.aflwriting.com
> 
> On 05/11/06, Keith McCombs <kmccombs@xxx> wrote:
> >
> >  What if Xmax and NY fall on Friday?
> >
> > Terry wrote:
> >
> >   You'll have to use the DayOfWeek function.
> >
> > DayOfWeek() == 5 on Friday which would translate too this assuming the
> > code otherwise works:
> >
> >
> >
> > EndOfWeek = DayOfWeek() == 5; //New line of code defining the end
of the
> > week
> >
> > Hi1 = IIf(EndOfWeek, Ref(HighestSince(EndOfWeek),H,1), 0);
> >
> >
> >
> > You can translate the rest of the code the same way.
> >
> > --
> >
> > Terry
> >
> > -----Original Message-----
> > *From:* amibroker@xxxxxxxxxxxxxxx
[mailto:amibroker@xxxxxxxxxxxxxxx] *On
> > Behalf Of *amon_gizeh
> > *Sent:* Saturday, November 04, 2006 11:04
> > *To:* amibroker@xxxxxxxxxxxxxxx
> > *Subject:* [amibroker] Pivot Points
> >
> >
> >
> > Hi.
> > I take the code below from AFL Library. How can I change month
with week?
> >
> > SetChartOptions(1,chartShowDates);
> >
> > Hi1 =
> >
> >
IIf(Month()!=Ref(Month(),-1),Ref(HighestSince(Month()!=Ref(Month(),-1),H,1),-1),0);
> > Hi = ValueWhen(Month()!=Ref(Month(),-1),Hi1,1);
> > Lo1 = IIf(Month()!=Ref(Month(),-1),Ref(LowestSince( Month()!=Ref
> > (Month(),-1), L,1),-1),0);
> > Lo = ValueWhen(Month()!=Ref(Month(),-1),Lo1,1);
> > CL1=IIf(Month()!=Ref(Month(),-1),Ref(C,-1),0);
> > CL = ValueWhen(Month()!=Ref(Month(),-1),CL1,1);
> > rg = Hi - Lo;
> > bp = (Hi+Lo+CL)/3;
> > R1 = (2*bP) - Lo ;
> > S1 = (2*bP) - Hi;
> > R2 = bP + rg;
> > S2 = bP - rg;
> >
> > Plot(C,"Close",colorBlack,styleCandle);
> > Plot(bp,"Pivot",colorRed,styleBar);
> > Plot(R1,"R1",colorBlue,styleBar);
> > Plot(S1,"S1",colorBlue,styleBar);
> > Plot(R2,"R2",colorBlue,styleBar);
> > Plot(S2,"S2",colorBlue,styleBar);
> >
> >    
> >
>




Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.14.11/542 - Release Date: 11/20/2006