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

[Metastockusers] New pattern - the charts speak



PureBytes Links

Trading Reference Links

=============
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<------------------------


jose '-)
http://www.metastocktools.com






------------------------ Yahoo! Groups Sponsor --------------------~--> 
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/cosFAA/zMEolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/Metastockusers/

<*> To unsubscribe from this group, send an email to:
    Metastockusers-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/