Rank: Advanced Member
Groups: Registered, Registered Users Joined: 6/3/2005(UTC) Posts: 181
|
1. No
2. Yes
--- George wrote:
> Dear Jose,
>
> Thank you very much!
>
> Please again see the following!
>
> Somewhere exist the YES OR NO.
>
> Please there, put your YES OR NO near of my YES OR NO.
>
> Also i receive and another E-Mail with another Formula, from you:
>
> Hi George,
>
> Just to prove how accurate the binary indicator is (and avoid lots of
> e-mails), try this test indicator:
>
>
> ===============================
> George-K - Extended Binary test
> ===============================
> ---8<---------------------------------------
>
> { Extends date signal by Nth weeks or months.
> Signal extension period is independent
> of any missing chart data.
>
> ©Copyright 2006 Jose Silva.
> The grant of this license is for personal use
> only - no resale or repackaging allowed.
> All code remains the property of Jose Silva.
> http://www.metastocktools.com }
>
> { User inputs }
> sigDay:=Input("signal Day",1,31,1);
> sigMth:=Input("signal Month",1,12,1);
> sigYear:=Input("signal Year",1800,2200,2006);
> pds:=Input("Extend date signal by x periods",
> 0,520,3);
> type:=Input("Extension periods, use: [1]Weekly, [2]Monthly",1,2,2);
> fill:=Input("Fill binary signal? [1]Yes, [0]No",0,1,0);
>
> { Selected date signal }
> signal:=Year()>sigYear
> OR (Year()=sigYear AND (Month()>sigMth
> OR Month()=sigMth AND DayOfMonth()>=sigDay));
> signal:=signal AND Alert(signal=0,2)
> OR Cum(1)=1;
>
> { Reference Calendar day/week counter }
> day:=Fml("George-K - Calendar Day counter");
> week:=FmlVar("George-K - Calendar Day counter","WKCOUNT");
>
> { Calendar month adjustment }
> m:=Month();
> nuMonth:=m<>Ref(m,-1) OR Cum(1)=2;
> leap:=Frac(Year()/4)=0 AND Frac(Year()/100)<>0
> OR Frac(Year()/400)=0;
> adj:=If(m=5 OR m=7 OR m=10 OR m=12,1,
> If(m=3,3-leap,0))*nuMonth;
> adj:=Cum(adj)-ValueWhen(1,signal,Cum(adj));
> mthPds:=pds*31-adj;
> mthPds:=If(mthPds<1,1,mthPds);
>
> { Count Calendar periods since signal }
> counter:=day-ValueWhen(1,signal,day);
> wkCounter:=week-ValueWhen(1,signal,week);
>
> { Extended signal binary by x periods }
> weekSignal:=wkCounter>=0 AND wkCounter<pds;
> weekSignal:=If(signal AND weekSignal=0,
> signal,weekSignal);
> mthSignal:=counter>=0 AND counter<mthPds;
>
> { Select weekly or monthly extension }
> extSignal:=If(type=1,weekSignal,mthSignal);
>
> { Eye candy }
> If(fill*extSignal,Frac(Cum(1)/2)=0,0);
> If(fill*extSignal,Frac(Cum(1)/2)<>0,0);
>
> { Plot in own window }
> extSignal
>
> ---8<---------------------------------------
>
>
> I want to ask you here, if is mandatory to create a New Indicator
> with Name, in the Indicator Builder of Metastock in which i will put
> the above Formula? YES OR NO
>
> Also if does not create the above Code as a New Formula, the 3
> Beginning Formulas work very well for my Work?:
>
> ==========================
> George-K - Original signal
> ==========================
>
> ===============================
> George-K - Calendar Day counter
> ===============================
>
> ===============================
> George-K - Extended Binary signal
> ===============================
>
> YES OR NO
|