logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

3 Pages<123
Options
Go to last post Go to first unread
kanellop  
#41 Posted : Saturday, May 20, 2006 9:21:59 AM(UTC)
kanellop

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/3/2005(UTC)
Posts: 181

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<--------------------------------------- Regards, jose http://www.metastocktools.com
kanellop  
#42 Posted : Saturday, May 20, 2006 9:23:40 AM(UTC)
kanellop

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/3/2005(UTC)
Posts: 181

Hi George, I'll start now to explain more about your two main indicators: "George-K - Extended Binary signal" "George-K - Extended Binary test" Both these indicators are very similar to each other - they both take a signal, and extend it for exactly three months. The "George-K - Extended Binary signal" indicator takes its original trigger signal from your "George-K - Original signal" indicator. The "George-K - Extended Binary test" indicator takes its trigger signal from its own date user input. The purpose of this second indicator is to test that both indicators indeed work as intended, that they both extend a signal accurately and exactly by three months. You can input any date in this test indicator, and you will see that the +1 signal continues from that date until exactly three months later. Once you can see that the indicators are accurate, you can then try experimenting with their user inputs: "Extend original signal by x periods" This user input allows other periods to be used - the default value is 3 (months). Choosing "0" will just plot the signal, "1" will extend that signal for 1 month, "2" for two months and so on. "Extension periods, use: [1]Weeks, [2]Months" This user input allows the choice of using either weeks or months for the signal extension. Choosing [1] will extend the signal by the previous user input number of weeks (3 weeks in this case). "Fill binary signal? [1]Yes, [0]No" This user input allows the extended signal to be "filled" by some lines, so that it is easier to see. It is not an important variable, and does not affect the extended signal at all. Once you understand the purpose of the "George-K - Extended Binary signal" indicator, then it's time to use it by referencing it in other indicators, or easier still, copying it as a separate indicator. Let's say that you wanted to trigger the following condition, but only for three months since the original trigger: condition:=C>Mov(C,21,S); The easiest method would be to make a copy of the "George-K - Extended Binary signal": MetaStock -> Tools -> Indicator Builder -> select "George-K - Extended Binary signal" indicator -> Copy. You would now have a new indicator named "George-K - Extended Binary signal(2)". Edit this indicator, and change these last few lines of code in it: >From original code: { Plot in own window } If(fill*extSignal,even,0); If(fill*extSignal,odd,0); extSignal To your new condition: { Plot in own window } condition:=C>Mov(C,21,S); extSignal*condition Your new "George-K - Extended Binary signal(2)" will now only plot the condition C>Mov(C,21,S) for three months after the original signal. Anyway, I'll leave you now to ask any questions. Regards, jose http://www.metastocktools.com
kanellop  
#43 Posted : Saturday, May 20, 2006 9:34:13 AM(UTC)
kanellop

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/3/2005(UTC)
Posts: 181

From Here and after exist some definitions Messages with Me and Jose in which, Jose answer Me with a YES OR A NO. George Kanellopoulos.
kanellop  
#44 Posted : Saturday, May 20, 2006 9:53:48 AM(UTC)
kanellop

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/3/2005(UTC)
Posts: 181

Yes. The modified "George-K - Extended Binary signal" will work correctly. Best Regards, jose --- George wrote: > Dear Jose, > > The Question that need an Answer with a YES OR NO is the > following: > > The Indicator that create after, as New Indicator into > the > Indicator Builder: > > ---8<--------------------------- > (HHV(H,20)-L)*100/HHV(H,20) > 15 > AND Fml("George-K - Extended Binary signal") > ---8<--------------------------- > > I want to ask here if does not create the above Formula as separate > formula > into the Indicator Builder, the Formula: > > ================================= > George-K - Extended Binary signal > ================================= > > which have inside the (ATTENTION): > > From this: > { Plot in own window } > If(fill*extSignal,even,0); > If(fill*extSignal,odd,0); > extSignal > > To this: > { Plot in own window } > (HHV(H,20)-L)*100/HHV(H,20) > 15 > AND extSignal > > will work correctly? > > PLEASE ANSWER ME ONLY WITH YES OR NO. >
> > George K. >
kanellop  
#45 Posted : Saturday, May 20, 2006 9:55:54 AM(UTC)
kanellop

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/3/2005(UTC)
Posts: 181

Answer from Jose: 1. No 2. Yes --- George wrote: > Dear Jose, > > Thank you! > > Please again see the following. > Somewhere exist the YES OR NO. > > Please there, put your YES OR NO near of my YES OR NO. > > I want to repeat that you do not need to create something New. I do > not need that! >
> > > Anyway, the Next Message is: > >After, the following Message that i sent you: > > Dear Jose, > > Hello Again. > > I want to ask you something important. > > You include on all that Formula/s, the Day Phenomenon that exist in > the February, every 4 Years with 29 Days? > > In my Message when, > > Suppose, > > the Signal occurs in 30 November 2005, > > Then the 3 Month Period for calculation is until and 28 and February > 2006. > > But forgot to say the following: > > Suppose now, > > the Signal occurs in 30 November 2004. > > Then the 3 Month Period for calculation is until and 29 February > 2004. > > So, you include and that in the Formula/s? > > Kind Regards, > > George Kanellopoulos. > > You answer me: > > Very good question. > > Of course, being the best MetaStock programmer in the world I had to > include provision for extremely accurate leap years (Feb 29) in the > formula. :) > > Plot this sample indicator from your project code: > > ---8<-------------------------------- > leap:=Frac(Year()/4)=0 AND Frac(Year()/100)<>0 > OR Frac(Year()/400)=0; > leap > ---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, is include > it the above Code in your 3 Beginning Formulas?: > > ========================== > George-K - Original signal > ========================== > > =============================== > George-K - Calendar Day counter > =============================== > > =============================== > George-K - Extended Binary signal > =============================== > > (I think that Yes.) > > YES OR NO. > > George K.
kanellop  
#46 Posted : Saturday, May 20, 2006 9:59:47 AM(UTC)
kanellop

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
kanellop  
#47 Posted : Saturday, May 20, 2006 10:02:10 AM(UTC)
kanellop

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/3/2005(UTC)
Posts: 181

YES --- George wrote: > Dear Jose, > > Thank you again. > > Please again see the following! > > Somewhere exist the YES OR NO. > > Please there, put your YES OR NO near of my YES OR NO. > > 8) Suppose that a Missing Data Date/s for example from Holiday, is > the Last Day/s of the 3,6,9 Month Period that you have put into the 3 > beginning Formulas. > > Also suppose that a Missing Data Date for example from Holiday, is > the 29th February, the Last Day of the 3,6,9 Month Period that you > have put into the 3 beginning Formulas. > > Also suppose that a Missing Data Dates for example from Holiday, is > the 28th & 29th February, the Last Days of the 3,6,9 Month Period > that you have put into the 3 beginning Formulas. > > Also suppose that a Missing Data Dates for example from Holiday, is > the 27th & 28th & 29th February, the Last Days of the 3,6,9 Month > Period that you have put into the 3 beginning Formulas. > > Also suppose that a Missing Data Dates for example from Holiday, are > more Days before 27th and the 27th & 28th & 29th February, the Last > Days of the 3,6,9 Month Period that you have put into the 3 beginning > Formulas. > > Example 1: > > A Signal was born in the 30 November (of any Year). So the 3 Month > Period goes until and 28 or 29 February of the Next Year. > Missing the Data Date 28 or 29 February of the Next Year or together > the 27 28 of the Next Year or together the 27, 28 and 29 February or > together the 25, 26, 27, 28, 29 February. > > But the Calculation of the 3 Month Period will include in your > Amazing 3 Formulas all the above Missing Data Dates examples? > > I mean it will include all the above Missing Data Days for > Calculation in the 3 Biginning Formulas > and will not go for Calculation of the 3 Months in the Period of the > 1, 2, 3, 4, 5 March of the Next Year for the Missing 1, 2, 3, 4 or 5 > Days of February? > > Example 2: > > A Signal was born in the 15 July (of any Year). So the 3 Month Period > goes until and 14 October of the Same Year. > > Missing the Data Date 14 October of the Same Year or together the 13, > 14 October of the Same Year or together the 12, 13 and 14 October or > together the 10, 11, 12, 13, 14 October. > > But the Calculation of the 3 Month Period will include in your > Amazing 3 Formulas all the above Missing Data Dates examples? > > I mean it will include all the above Missing Data Days for > Calculation in the 3 Biginning Formulas > and will not go for Calculation of the 3 Months in the Period of the > 15, 16, 17, 18, 19 October of the Same Year for the Missing 1, 2, 3, > 4 or 5 Days of October? > > The above Phenomena are include in the 3 beginning Formulas?: > > ========================== > George-K - Original signal > ========================== > > =============================== > George-K - Calendar Day counter > =============================== > > =============================== > George-K - Extended Binary signal > =============================== > YES OR NO. > > George K.
kanellop  
#48 Posted : Saturday, May 20, 2006 10:06:21 AM(UTC)
kanellop

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/3/2005(UTC)
Posts: 181

YES --- George wrote: > Dear Jose, > > Thank you again. > > Please again see the following! > > Somewhere exist the YES OR NO. > > Please there, put your YES OR NO near of my YES OR NO. > > 9) You told me in an E-Mail: > > ...Let's say that you wanted to trigger the following condition, but > only > for three months since the original trigger: > condition:=C>Mov(C,21,S); > > The easiest method would be to make a copy of the "George-K - > Extended > Binary signal": > > MetaStock -> Tools -> Indicator Builder -> select "George-K - > Extended > Binary signal" indicator -> Copy. > > > You would now have a new indicator named "George-K - Extended Binary > signal(2)". Edit this indicator, and change these last few lines of > code in it: > > From original code: > > { Plot in own window } > If(fill*extSignal,even,0); > If(fill*extSignal,odd,0); > extSignal > > To your new condition: > > { Plot in own window } > condition:=C>Mov(C,21,S); > extSignal*condition > > > Your new "George-K - Extended Binary signal(2)" will now only plot > the > condition C>Mov(C,21,S) for three months after the original signal. > > That mean's that does not need to create a separate Formula first in > the Indicator Builder of Metastock, i mean the: > > ---8<--------------------------- > C>Mov(C,21,S); > AND Fml("George-K - Extended Binary signal(2)") > ---8<--------------------------- > > YES OR NO.
kanellop  
#49 Posted : Saturday, May 20, 2006 10:08:11 AM(UTC)
kanellop

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/3/2005(UTC)
Posts: 181

YES. Cheers, jose --- George wrote: > Dear Jose, > > Thank you again. > > Please again see the following! > > > Somewhere exist the YES OR NO. > > Please there, put your YES OR NO near of my YES OR NO. > > 10) Exist the Formula: > > "George-K - Extended Binary test" > > That Formula show me from the Day i will choose in that Formula, > > until the Day, exactly after 3 Months later? > > YES OR NO. > > George K.
kanellop  
#50 Posted : Saturday, May 20, 2006 10:11:46 AM(UTC)
kanellop

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/3/2005(UTC)
Posts: 181

The Project End! I hope to understand it very well! Kind Regards, George Kanellopoulos.
kanellop  
#51 Posted : Saturday, May 20, 2006 10:50:17 AM(UTC)
kanellop

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/3/2005(UTC)
Posts: 181

I decide to put here and not to the beginning(because of my Mistake) the Messages that sent to Jose, and the Replies from Him, when i asked from him to create the Project. After that Messages i received the Project from Jose that i had publi[censored] So, here it is the Message to Jose if can create the Project, Here it is: I want to repeat here my basic thought again. Do you believe that exist Date Formula which can make the following thing: When a Formula occurs in any Day, for example the Formula/s: Fml("APO L 120") (or for example, the other Formula Fml("APO H 120") or any other Formula that someone can imagine if you like), then from the Day that the above Formula is TRUE, meaning that occurs, or we have TRUE Signal of it, until exactly after 3 Months (For Example), to be True or False the following Metastock Formula: (HHV(H, 20)-L)*100/HHV(H, 20) > 15 For example, suppose that the Fml("APO L 120") (or for example, the other Formula Fml("APO H 120") or any other Formula that someone can imagine if you like), occur exactly the 31/10/2005, then, when happen that, the (HHV(H, 20)-L)*100/HHV(H, 20) > 15, from 31/10/2005 until exactly 31/01/2006 to be True or otherwise False, so, to receive Price 1 for the True and 0 for the False. Attention. If we have a Signal of Fml("APO L 120") (or for example, the other Formula Fml("APO H 120") or any other Formula that someone can imagine if you like), the 3 Month Period Time will start to count, but if in that Time Period of 3 Months a NEW SIGNAL/S, give us the Fml("APO L 120") (or for example, the other Formula Fml("APO H 120") or any other Formula that someone can imagine if you like), the 3 Month Period Time will count again from that Period of the NEW SIGNAL/S that born. The results of the previous Signal doesn’t matter if it 0 or 1 will be in the Chart until the NEW SIGNAL/S (if exist) occurs in that example. Suppose now, the Signal occurs in 30 November 2005. Then the 3 Month Period is until and 28 February 2006. Suppose a Signal that occurs in 01 January 2005 then the 3 month Period after that Day, is until and 31 March 2005. Suppose a Signal that occurs in 15 January 2005 then the 3 month Period after that Day, is until and 14 April 2005 etc. I do not remember well how Metastock Formula Language calculate theMonth() Period, i mean calculate it like the above examples or, like, Suppose the Signal occurs in 30 November 2005. Then the 3 Month Period is until and 28 February 2006. Suppose a Signal that occurs in 01 January 2005 then the 3 month Period after that Day, is until and 01 April 2005. Suppose a Signal that occurs in 15 January 2005 then the 3 month Period after that Day, is until and 15 April 2005 etc. Do you believe that can exist a Formula like that? Kind Regards, George Kanellopoulos
kanellop  
#52 Posted : Saturday, May 20, 2006 10:52:26 AM(UTC)
kanellop

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/3/2005(UTC)
Posts: 181

Hi George, I believe that I can code your indicator using MetaStock formula language As I understand it: Extend binary signal (+1/0) for exactly three calendar months, and reset and start counting again if a new signal appears in the meantime. Regards, jose
kanellop  
#53 Posted : Saturday, May 20, 2006 10:56:52 AM(UTC)
kanellop

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/3/2005(UTC)
Posts: 181

I asked Jose: When does not exist any Signal, the Formula will receive Price of 0 in the Inner Window? Jose answer Me: Hi George, kanellop wrote: When does not exist any Signal, the Formula will receive Price of 0 in the Inner Window? Yes, that's correct. If no signal has ocurred in the past 3 months (user variable), then the binary signal will be "0". Regards, jose
kanellop  
#54 Posted : Saturday, May 20, 2006 11:07:06 AM(UTC)
kanellop

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 6/3/2005(UTC)
Posts: 181

Please, for this Project, first see the 3 Topics: 1) NEW VERY IMPORTANT MESSAGE. 2) ANSWER FROM JOSE 1. 3) ANSWER FROM JOSE 2. Then go to Topic: Message for that Formula Project., and Start to read the Project! I APOLOGIZE TO ALL... FOR THAT!!! Kind Regards, George Kanellopoulos.
Users browsing this topic
Guest (Hidden)
3 Pages<123
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.