Rank: Advanced Member
Groups: Registered, Registered Users Joined: 1/19/2005(UTC) Posts: 1,065 Location: Koh Pha-Ngan, Earth
Was thanked: 2 time(s) in 2 post(s)
|
And here's another indicator variation: the market's eye:
[code:1:b3ae00b463]
============
Market's eye
============
---8<----------------------------
{ Keep an eye on your charts... v1.0 }
{ Hint: trade in the opposite direction to
the market eye's gaze.
Outside zone bounded by chart's High & Low
of selected period.
Plot on price chart with dark colors.
Zoom chart in & out for effects.}
{ ©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);
spread:=Input("Iris size",0,2600,10);
spread:=
LastValue(Int(Min((pds1-pds2)/4,spread)));
{ 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);
{ Eyeball }
start:=Cum(1)=LastValue(Cum(1))-p1;
restrict:=Ref(Ref(ValueWhen(1,start,1),-p2),p2);
Hi:=LastValue(Highest(ValueWhen(1,restrict,H)))
+restrict-1;
Lo:=LastValue(Lowest(ValueWhen(1,restrict,L)))
+restrict-1;
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)));
upperE1:=Lo+midY+ellipse;
lowerE1:=Hi-midY-ellipse;
{ Cornea }
p1:=p1-spread;
p2:=p2+spread;
start:=Cum(1)=LastValue(Cum(1))-p1;
restrict:=Ref(Ref(ValueWhen(1,start,1),-p2),p2);
Hi:=LastValue(Highest(ValueWhen(1,restrict,H)))
+restrict-1;
Lo:=LastValue(Lowest(ValueWhen(1,restrict,L)))
+restrict-1;
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)));
upperE2:=Lo+midY+ellipse;
lowerE2:=Hi-midY-ellipse;
{ Iris }
p1:=p1-spread;
p2:=p2+spread;
start:=Cum(1)=LastValue(Cum(1))-p1;
restrict:=Ref(Ref(ValueWhen(1,start,1),-p2),p2);
Hi:=LastValue(Highest(ValueWhen(1,restrict,H)))
+restrict-1;
Lo:=LastValue(Lowest(ValueWhen(1,restrict,L)))
+restrict-1;
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)));
upperE3:=Lo+midY+ellipse;
lowerE3:=Hi-midY-ellipse;
even:=Cum(1)/2=Int(Cum(1)/2);
{ Plot on price chart }
If(even,upperE3,lowerE3);
If(even,lowerE3,upperE3);
upperE1;lowerE1;
upperE2;lowerE2;
upperE3;lowerE3
---8<----------------------------
[/code:1:b3ae00b463]
jose '-)
http://www.metastocktools.com
|