MetaStock™ Zone Forum & FAQ Artykuły Linki Elliott Waves EasyLanguage™ Zone

 A B C D E F G H I J K L M N O P R S T U V W Y Z #

Affine Geometry by Viktor Likhovidov
The formula given in "Affine Geometry Of The Markets" by Viktor Likhovidov in
this issue can be easily recreated in MetaStock 6.52 or higher. To create a formula in MetaStock, select Indicator Builder from the Tools menu, click New, enter the code for the formula, and then click OK. Repeat for the remaining formulas.

A single formula can be used to plot the rising and falling transforms. It prompts you for two points on the trendline. For both points, you must input a date and a time. If you're working in an end-of-day chart, leave the time prompts at zero. You can also input a scaling factor to accentuate the curve ("slope scaling factor") and shift the result to prevent negative numbers ("display shift value").

Affine Geometry

sx:=Input("date of first point [ mmddyyyy ]",1,12350000,1032000);
sxt:=Input("intraday time of first point[ 24 hour - hhmm ]",0,2460,0);
ex:=Input("date of second point [ mmddyyyy ]",1,12350000,1032001);
ext:=Input("intraday time of second point[ 24 hour - hhmm ]",0,2460,0);
prs:=Input("scaling factor for slope calculation",1,100000,1);
ops:=Input("shift value for affine display",0,100000,0);
sdt:= (Month()=Int(sx/1000000)) AND
(DayOfMonth()=Rnd(Frac(Int(sx/10000)/100)*100)) AND
(Year()=Rnd(Frac(sx/10000)*10000)) AND
(Hour()= Int(sxt/100)) AND
(Minute()=Rnd(Frac(sxt/100)*100));
edt:=Month()=Int(ex/1000000) AND
DayOfMonth()=Rnd(Frac(Int(ex/10000)/100)*100) AND
Year()=Rnd(Frac(ex/10000)*10000) AND
(Hour()= Int(ext/100)) AND
(Minute()=Rnd(Frac(ext/100)*100));
rise:=LastValue((ValueWhen(1,edt,C)-ValueWhen(1,sdt,C))*prs);
run:=LastValue(ValueWhen(1,edt,Cum(1))-ValueWhen(1,sdt,Cum(1)));
sl:=rise/run;
tr:=((C-LastValue(ValueWhen(1,sdt,C)))-(Cum(1)-LastValue(ValueWhen(1,sdt
,Cum(1))))*sl);
tr+ops

--William Golson, Equis International
www.equis.com
Source / From: TOP