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

Notification

Icon
Error

2 Pages12>
Options
Go to last post Go to first unread
weird  
#1 Posted : Thursday, February 2, 2006 10:00:00 AM(UTC)
weird

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 8/3/2005(UTC)
Posts: 40

Pretty impressive MS coding in the latest S & C Feb 2006, for identifying cup patterns. It is heavily based on using the lastvalue function, nevertheless the signal is valid for the day the exploration is run. I was wondering what would be required to show previous signals ? UserPostedImage The chart shown is not the best example, but what showed up on the full ASX, and I have provided as an example. Pretty cool coding I think, to produce the curve as well. Go Giorgos Siligardos, Ph.D ! =D> Many thanks in advance <Sorry edited post as having problems with hosting images at my previous spot> regards Dave
mstt  
#2 Posted : Thursday, February 2, 2006 10:13:24 AM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
Hi Dave Without seeing the code I can't quote specifics, but as a rule patterns that use LastValue() can only be identified once on a chart using MFL - usually the most recent occurrence. There may be exceptions but it's unlikely unless a supporting DLL is used. Roy MetaStock Tips & Tools
weird  
#3 Posted : Thursday, February 2, 2006 10:38:46 AM(UTC)
weird

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 8/3/2005(UTC)
Posts: 40

1. Moderators, is there any issues with posting the code ? 2. Also is it possible to have a general dll or something to provide this functionality ? I do not understand why signals valid today which rely on the lastvalue function, are unable to be backtested. Why do these coders feel they need to use the lastvalue function in order to produce the required code to find the type of patterns they are looking for ? This may be education on my part. I have seen some great code, like the above and for trend line breaks, that rely on the lastvalue function. Is it possible to have this functionality provided for indicators that use the lastvalue function to be able to be backtested, that is , for past signals to be produced ? Many thanks. regards Dave Many thanks stockman !
StorkBite  
#4 Posted : Thursday, February 2, 2006 7:58:38 PM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
Quote:
Moderators, is there any issues with posting the code ?
Checking... Update: I am waiting on a reply from the Author. As soon as I get word, I'll let you know.
emanZZZZ  
#5 Posted : Friday, February 3, 2006 5:13:27 AM(UTC)
emanZZZZ

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 2/3/2006(UTC)
Posts: 5

I have tried to run this code, but keep getting a error. HHV error invalid time period 0 or null. The hhv function seems to be working ok, the problem seems to be tied to the lastValue function. Anybody else having this problem or any thoughts or suggestions.
StorkBite  
#6 Posted : Friday, February 3, 2006 6:44:27 PM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
Thanks to the kind generosity of Giorgos Siligardos, he has made his Cup & Handle work available to the Equis Forum. The indicators, expert and explorer are attached to this thread, and will be available in the download section, too. After you unzip the files, you will need to import them into MS. They are compatible with version 9.x. If you are not familiar with importing formulas, the all you have to do is open MS, select TOOLS | INDICATOR BUILDER | ORGANIZER | IMPORT and select the folder containing the cup & handle work. This will create several files in MS for you, including: Indicators: Iscup, Iscup-Plot Explorer: Iscup Template: Cup&Handle Have fun with this. If you'd like to check out more work by Mr. Siligardos, please visit his website: http://www.daedalussoft.com/
weird  
#7 Posted : Saturday, February 4, 2006 2:26:43 AM(UTC)
weird

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 8/3/2005(UTC)
Posts: 40

Thanks Stockman, [code:1:36ea0a0878]{0}P1:=LastValue(HHV(Log(H),20)); HighBar:=LastValue(Cum(1)-BarsSince(Log(H)=P1)); cupperiod:=LastValue(BarsSince(Ref(Log(H)-LastValue(Cum(1)-HighBar),-1)>P1)+1); handleperiod:=LastValue(Cum(1)-highbar); totalperiod:=LastValue(Max(1,cupperiod+handleperiod)); p0:=LastValue(LLV(Log(L),totalperiod)); b0:=LastValue(Highbar-cupperiod+1); b1:=LastValue(Highbar-Int(4*cupperiod/5)); b2:=LastValue(Highbar-Int(3*cupperiod/5)); b3:=LastValue(Highbar-Int(2*cupperiod/5)); b4:=LastValue(Highbar-Int(cupperiod/5)); boxheight:=LastValue(Abs(P1-P0)/5); L1:=P0+boxheight; L2:=P0+2*boxheight; L3:=P0+3*boxheight; L4:=P0+4*boxheight; iscup:= {1}cupperiod>30 AND {2}((Cum(If(Cum(1)>b1 AND Cum(1)<b4,Log(C)>=L3,0))+ Cum(If(Cum(1)>b2 AND Cum(1)<b3,Log(C)>=l2,0)))=0) AND {3}(((Cum(If(Cum(1)>b1 AND Cum(1)<b2,Log(L)<(l1-boxheight/3),0))>0) AND (Cum(If(Cum(1)>b3 AND Cum(1)<b4,Log(L)<(l1-boxheight/3),0))>0)) OR ((Cum(If(Cum(1)>b0 AND Cum(1)<b1,Log(L)<(l2-boxheight/3),0))>0) AND (Cum(If(Cum(1)>b4 AND Cum(1)<highbar,Log(L)<(l2-boxheight/3),0))>0))) AND {4}LLV(Log(C),handleperiod+1)>L2; iscup;[/code:1:36ea0a0878] Any ideas how one would one go about manipulating the code, to produce past signals ? The above approach used for pattern recognition, may lend itself to finding other useful types of patterns. Also atleast in my testing, using the price value instead of the log produces more signals. I am battling quite abit with replacing the lastvalue function in my attempts to reproduce this to determine past signals. Perhaps an additional function in the forum dll or can this be solved another way ?
emanZZZZ  
#8 Posted : Saturday, February 4, 2006 4:46:05 AM(UTC)
emanZZZZ

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 2/3/2006(UTC)
Posts: 5

When MS tries to load the expert I get a MSX error. Any ideas?
StorkBite  
#9 Posted : Saturday, February 4, 2006 11:10:07 AM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
R U using version 9.x of MS?
emanZZZZ  
#10 Posted : Monday, February 6, 2006 4:43:42 AM(UTC)
emanZZZZ

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 2/3/2006(UTC)
Posts: 5

Yes. 9.0
StorkBite  
#11 Posted : Monday, February 6, 2006 4:48:01 AM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
What is the exact error?
emanZZZZ  
#12 Posted : Monday, February 6, 2006 5:51:30 PM(UTC)
emanZZZZ

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 2/3/2006(UTC)
Posts: 5

The following tools contain syntax errors that prevent them from compiling properly. The errors may be caused by Custom Formulas or MSX DLLs that are unavailable to this set of tools.
StorkBite  
#13 Posted : Tuesday, February 7, 2006 1:27:24 AM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
Hey Z- Did you install the indicators using the import function? i.e., open MS, select TOOLS | INDICATOR BUILDER | ORGANIZER | IMPORT and select the folder containing the cup & handle work. If so, you might try to install again. I'm not sure what formula is not being found. You might take a look at the installation list earlier in this post to make sure everything is there. Other than that, does anyone else have any ideas?
emanZZZZ  
#14 Posted : Thursday, February 9, 2006 5:54:00 PM(UTC)
emanZZZZ

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 2/3/2006(UTC)
Posts: 5

I installed everything using the import function. I have set the template up. However, in the code there should be an expert that loads as well. On the loading of this expert is where the error occurs. Also, I have run the exploration for a week with no hits. Is this correct? If anyone has run this code and identified c&h, could you please let me know what day and what security triggered the hit? Thanks Z
StorkBite  
#15 Posted : Thursday, February 9, 2006 8:06:59 PM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
Z- By my own exam, the expert that is included contains 2 formulas- both listed in the Highlights section of the Expert. There is no commentary. <<Cup>> [code:1:1f14886dcb]IsCup:= Fml( "IsCup"); b0:= FmlVar("IsCup","B0"); Highbar:=FmlVar("IsCup","Highbar"); If(LastValue(IsCup),Cum(1)>=b0 AND Cum(1)<=Highbar,0);[/code:1:1f14886dcb] <<Handle>> [code:1:1f14886dcb]IsCup:= Fml( "IsCup"); Highbar:=FmlVar("IsCup","Highbar"); If(LastValue(iscup),Cum(1)>Highbar,0);[/code:1:1f14886dcb] I experienced no problems with the installation. IMO, the Cup & Handle method as published seems to work fine. It appears to be 'picky' about what it calls a cup & handle, but I prefer it to be... less false positives. I think this is truly innovative work and am pleasantly surprised that Mr. Siligardos made his work available to us- free, no less. Such altruism is a rare quality these days. At random, one pattern I identified was with us;upcf. The chart is attached. UserPostedImage
siligard  
#16 Posted : Thursday, February 9, 2006 8:13:38 PM(UTC)
siligard

Rank: Newbie

Groups: Registered, Registered Users
Joined: 2/7/2006(UTC)
Posts: 8
Location: Greece

I find no errors importing the formulas from the CupAndHandle Folder using the Formula Organizer. However, since you experience an error see at the end of this post. I have written the indicator formulas. As far as the Exploration is concerned, check that the exploration is performed using many historical bars. UserPostedImage Also, when opening a chart from the Exploration results, check the periodicity of the chart and the periodicity of the exploration. In the majority of cases the periodicities must match if you want to see the cup plotted. Best Regards, Giorgos E. Siligardos e-mail: siligard@daedalussoft.com http://www.daedalussoft.comight; L2:=P0+2*boxheight; L3:=P0+3*boxheight; L4:=P0+4*boxheight; iscup:= {1}cupperiod >30 AND {2}((Cum(If( Cum(1)>b1 AND Cum(1)<b4, Log(C)>=L3,0))+ Cum(If( Cum(1)>b2 AND Cum(1)<b3, Log(C)>=L2,0)))=0) AND {3}(((Cum(If(Cum(1)>b1 AND Cum(1)<b2, Log(L)<(L1-boxheight/3),0))>0) AND (Cum(If(Cum(1)>b3 AND Cum(1)<b4, Log(L)<(L1-boxheight/3),0))>0)) OR ((Cum(If(Cum(1)>b0 AND Cum(1)<b1, Log(L)<(L2-boxheight/3),0))>0) AND (Cum(If(Cum(1)>b4 AND Cum(1)<Highbar, Log(L)<(L2-boxheight/3),0))>0))) AND {4}LLV(Log(C),handleperiod+1)>L2 ; iscup;
Create the following Indicator which will be used to graph the function f
Name: IsCup-Plot Formula: Iscup:= Fml( "IsCup") ; P0:= FmlVar("IsCup","P0"); P1:= FmlVar("IsCup","P1"); B0:= FmlVar("IsCup","B0"); Bcenter:=(FmlVar("IsCup","B2")+FmlVar("IsCup","B3"))/2; Handleperiod:=FmlVar("IsCup","Handleperiod"); {plot} plotarea:=(1+BarsSince(Cum(1)>=b0))*Ref(1,LastValue(handleperiod-1)); halfper:=B0-Bcenter; a:=(Exp(P1)-Exp(P0))/Power(If(halfper=0,1,halfper),6); If(LastValue(iscup),plotarea,BarsSince(LastValue(iscup)))*Min(Exp(P1),(a*(Power(Cum(1)-Bcenter,6)) + Exp(P0)*0.99));
Open The Exploration Editor and create a new exploration Name: IsCup Filter: Fml( "IsCup") =1 Column A: Col. Name: CupPer Formula: FmlVar("IsCup","CUPPERIOD") Column B: HandlePer Col. Name: HandlPe Formula: FmlVar("IsCup","HANDLEPERIOD") Column C: Col. Name: CupHeig% Formula: ( Exp(FmlVar("IsCup","P1")) / Exp(FmlVar("IsCup","P0") ) -1 )*100
Open The Expert Advisor and create a new expert with name "Cup coloring". Create two Highlights which will be used to color the cup. Color for the first Highlight: Blue Formula for the first Highlight: IsCup:= Fml( "IsCup"); b0:= FmlVar("IsCup","B0"); Highbar:=FmlVar("IsCup","Highbar"); If(LastValue(IsCup),Cum(1)>=b0 AND Cum(1)<=Highbar,0); Color for the second Highlight: Cyan Formula for the second Highlight: IsCup:= Fml( "IsCup"); Highbar:=FmlVar("IsCup","Highbar"); If(LastValue(iscup),Cum(1)>Highbar,0); -----------------------
jschott  
#17 Posted : Sunday, February 19, 2006 3:13:24 AM(UTC)
jschott

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 8/19/2005(UTC)
Posts: 3
Location: East Coast

While this is not what you want, if you adjust the X-Axis display to a specific date, you can see the "hits" on that date. For example, if I load in enough data and then make the Last Date setting on the XAxis to be the same, I can generate the same charts shown in the TASC article by the author. If you continue to extend the date, eventually you get the Cup to vanish. PS Thanks to the author, too, for extending email help when I didn't know what I was doing.
deerisaw  
#18 Posted : Friday, April 14, 2006 2:07:00 PM(UTC)
deerisaw

Rank: Newbie

Groups: Registered, Registered Users
Joined: 4/6/2006(UTC)
Posts: 9
Location: USA

I for one wish to thank the author for this indicator/explorer. The C&H formation doesn't show up that often and that is why it doesn't spit out a positive search result each time it is run. I used to check each individual stock on another website by manually entering each stock from my watchlist. MS and this explorer will run it quickly for me without the hard work I ran a search on April 14th and came up with CRED. I'll try to keep an update on it. Thank you, Mr. Siligardos.
royttm  
#19 Posted : Monday, October 9, 2006 2:08:32 AM(UTC)
royttm

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 3/27/2006(UTC)
Posts: 41
Location: Singapore

I wish to make a heartfelt thank you to the creator & StorkBite who direct me to the website with the C&H free downloadable "program" for Metastock indicator/explorer. It had indeed help me in identifying with speed, the stock that exhibits C&H pattern.

Contribution of my experiences for those who can't find any identified stock with the C&H pattern "program" after using "The Explorer", try increasing the Data Loading in the Option at the "The Explorer"; instead of leaving it to "Load Minimum Records", probably you could set it to a higher numbers, say 750 (~ 3 years data)......Hope this helps.

stevedean63  
#20 Posted : Sunday, November 12, 2006 8:10:39 PM(UTC)
stevedean63

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 4/27/2005(UTC)
Posts: 2

I am having trouble with getting the cup w/handle exploration to come up with a positive result.

I have tried 3 different ways to enter it. First I tried to download it from the website http://www.daedalussoft.com. I ran an exploration for each day of the past week plus 4/14/06 because "deerisaw" wrote a post in this thread stating he had a positive for CRED on that date.

Next I tried to copy and paste it Giorgos E. Siligardos post in this thread. Again I ran an exploration for each day of the past week plus 4/14/06 with no success.

Finally I found the files under the "File" tab on this equis community web page, downloaded the files and imported them by selecting TOOLS | INDICATOR BUILDER | ORGANIZER | IMPORT. Again I ran the exploration for the same time periods indicated earlier with no success.

Can anyone help me with what I may have done wrong? Also, as a test can someone who has gotten the exploration to work give me a positive result including the day and security that came back positive.

Thanks for the help.

Users browsing this topic
Guest (Hidden)
2 Pages12>
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.