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

Error

 Previous Topic Next Topic
 Jose #1 Posted : Friday, May 6, 2005 10:55:31 PM(UTC) Rank: Advanced MemberGroups: Registered, Registered UsersJoined: 1/19/2005(UTC)Posts: 1,065Location: Koh Pha-Ngan, EarthWas thanked: 2 time(s) in 2 post(s) [code:1:8e62d05ed2] ============= Luscious Lips ============= ---8<------------------------ { Luscious Lips - the markets speak - v1.0 } { Lips/Ellipse bounded by High & Low of selected period.} { Use red, plum or purple plot colors.} { ©Copyright 2005 Jose Silva } { For personal use only } { http://www.metastocktools.com } { User inputs } pds1:=Input("Start periods ago",2,2600,70); pds2:=Input("End periods ago",0,2600,5); plot:=Input("[1]Ellipse, [2]Fill, [3]Both", 1,3,2); { Remove possible errors introduced between keyboard & seat ;) } p1:=LastValue(Max(pds1,pds2)); p2:=LastValue(Min(pds1,pds2)); p1:=If(p1<(p2+2),p2+2,p1); { Define/Restrict plot period } start:=Cum(1)=LastValue(Cum(1))-p1; end:=Cum(1)=LastValue(Cum(1))-p2; restrict:=Ref(Ref(ValueWhen(1,start,1),-p2),p2); { Upper/Lower lip boundaries } Hi:=LastValue(Highest(ValueWhen(1,restrict,H))) +restrict-1; Lo:=LastValue(Lowest(ValueWhen(1,restrict,L))) +restrict-1; { Ellipse - with thanks to MG Ferreira } midX:=(p1-p2)/2; midY:=(Hi-Lo)/2; tX:=Cum(1)-midX-(LastValue(Cum(1))-p1); ellipse:= Sqrt(midY*midY*(1-Min(tX*tX/midX/midX,1))); upperE:=Lo+midY+ellipse; lowerE:=Hi-midY-ellipse; { Eye candy } even:=Cum(1)/2=Int(Cum(1)/2); fill1:=If(even,upperE,lowerE); fill2:=If(even,lowerE,upperE); { Plot in price chart } If(plot=2,fill1,upperE); If(plot=2,fill2,lowerE); If(plot=1,upperE,fill1); If(plot=1,lowerE,fill2) ---8<------------------------ [/code:1:8e62d05ed2] jose '-) http://www.metastocktools.com
 Wanna join the discussion?! Login to your Discussions forum accountor Register a new forum account.
 minnamor #2 Posted : Saturday, May 7, 2005 9:28:17 AM(UTC) Rank: Advanced MemberGroups: Registered, Registered UsersJoined: 4/27/2005(UTC)Posts: 126Location: Italy This is really a major feat of MS programming! Any suggestion on the use of the pattern or where such information can be found? I could see the application of this in implemeting the PHI-Ellipse described in "The New Fibonacci Trader" by Robert Fisher.
 Jose #3 Posted : Saturday, May 7, 2005 2:13:48 PM(UTC) Rank: Advanced MemberGroups: Registered, Registered UsersJoined: 1/19/2005(UTC)Posts: 1,065Location: Koh Pha-Ngan, EarthWas thanked: 2 time(s) in 2 post(s) This indicator is similar to the Boxed-Ellipse pattern, both of which probably have little use for trading, but may be somewhat useful in detecting patterns. Personally, I just find it entertaining to plot the indicator, and zoom in/out the price chart - perhaps I may need a new hobby. :) jose '-) http://www.metastocktools.com
 Jose #4 Posted : Sunday, May 8, 2005 7:35:47 AM(UTC) Rank: Advanced MemberGroups: Registered, Registered UsersJoined: 1/19/2005(UTC)Posts: 1,065Location: Koh Pha-Ngan, EarthWas thanked: 2 time(s) in 2 post(s) New! New! New! Version 2 - now with lip gloss maximum factor (Max Factor parameter). :D [code:1:e7fc25ce9d] ============= Luscious Lips ============= ---8<------------------------ { Luscious Lips - the chart speaks - v2.0 } { Lips/Ellipse bounded by chart's High & Low of selected period.} { Plot on price chart with Red, Plum or Purple colors. Zoom-in & out for fuller lips.} { ©Copyright 2005 Jose Silva } { For personal use only } { http://www.metastocktools.com } { User inputs } pds1:=Input("Start periods ago",2,2600,70); pds2:=Input("End periods ago",0,2600,5); gloss:=Input("Lip gloss - Max Factor", 1,100,100); plot:=Input("[1]Ellipse, [2]Fill, [3]Both", 1,3,2); { Remove possible errors introduced between keyboard & seat ;) } p1:=LastValue(Max(pds1,pds2)); p2:=LastValue(Min(pds1,pds2)); p1:=If(p1<(p2+2),p2+2,p1); { Define/Restrict plot period } start:=Cum(1)=LastValue(Cum(1))-p1; end:=Cum(1)=LastValue(Cum(1))-p2; restrict:=Ref(Ref(ValueWhen(1,start,1),-p2),p2); { Upper/Lower lip boundaries } Hi:=LastValue(Highest(ValueWhen(1,restrict,H))) +restrict-1; Lo:=LastValue(Lowest(ValueWhen(1,restrict,L))) +restrict-1; { Ellipse - with thanks to MG Ferreira } midX:=(p1-p2)/2; midY:=(Hi-Lo)/2; tX:=Cum(1)-midX-(LastValue(Cum(1))-p1); ellipse:= Sqrt(midY*midY*(1-Min(tX*tX/midX/midX,1))); upperE:=Lo+midY+ellipse; lowerE:=Hi-midY-ellipse; { Lipstick } gloss:=Int(200*Power(gloss,-1)); even:=Cum(1)/gloss=Int(Cum(1)/gloss); fill1:=If(even,upperE,lowerE); fill2:=If(even,lowerE,upperE); { Plot in price chart } If(plot=2,fill1,upperE); If(plot=2,fill2,lowerE); If(plot=1,upperE,fill1); If(plot=1,lowerE,fill2) ---8<------------------------ [/code:1:e7fc25ce9d] jose '-) http://www.metastocktools.com
 Jose #5 Posted : Sunday, May 8, 2005 9:22:30 PM(UTC) Rank: Advanced MemberGroups: Registered, Registered UsersJoined: 1/19/2005(UTC)Posts: 1,065Location: Koh Pha-Ngan, EarthWas thanked: 2 time(s) in 2 post(s) The "Luscious Lips" MetaStock indicator is a visual/fun thing - not really suitable for explorations. MetaStock -> Tools -> Indicator Builder -> New -> Copy and paste complete formula between "---8<---" lines. jose '-) http://www.metastocktools.com