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
http://www.traders.com

Equis and MetaStock® and MetaStock Professional® are registered trademarks of Equis International. Achelis Binary Wave®, The DownLoader®,
Expert Advisor®, OptionScope®, Quotecenter® and Smart Charts® are trademarks of Equis International, a Thomson Reuters company.

TradeStation® Pro, TradeStation® 2000i, OptionStation®, SuperCharts®, PowerEditor® and EasyLanguage®
are registered trademarks of TradeStation Technologies, Inc. Other names and marks referred to are the property of their respective owners.

All information provided on this website is for educational purposes only. Trading involves risk, including possible loss of principal and other losses.

Ten i inne materiały na tej stronie zostały zamieszczone zostały jedynie w celach edukacyjnych, nie ponoszę żadnej odpowiedzialno¶ci za ich stosowanie.

Gra na giełdzie i rynkach walutowych (FOREX) niesie ze sob± ryzyko poważnych strat finansowych!