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 #

Rate of Return Indicator by Alan Hull

Alan Hull's Rate of Return Indicator, translated from TradeStaion code.

MetaStock -> Tools -> Indicator Builder -> New

Copy and paste all formulae below. Plot only last formula.


RorPlot1

{ http://www.metastocktools.com }

If(Round(
(6.854*LinearReg(C,13)
+4.236*LinearReg(LinearReg(C,13),11)
+2.618*LinearReg(LinearReg(LinearReg(C,13),11),7)
+1.618*LinearReg(LinearReg(LinearReg(LinearReg(C,13),11),7),5)
+LinearReg(LinearReg(LinearReg(LinearReg(LinearReg(C,13),11),7),5),3))
/16.326*100)/100 > PREV
,If(Round(
(6.854*LinearReg(C,13)
+4.236*LinearReg(LinearReg(C,13),11)
+2.618*LinearReg(LinearReg(LinearReg(C,13),11),7)
+1.618*LinearReg(LinearReg(LinearReg(LinearReg(C,13),11),7),5)
+LinearReg(LinearReg(LinearReg(LinearReg(LinearReg(C,13),11),7),5),3))
/16.326*100)/100 - (2.5*ATR(13)) > PREV
,Round(
(6.854*LinearReg(C,13)
+4.236*LinearReg(LinearReg(C,13),11)
+2.618*LinearReg(LinearReg(LinearReg(C,13),11),7)
+1.618*LinearReg(LinearReg(LinearReg(LinearReg(C,13),11),7),5)
+LinearReg(LinearReg(LinearReg(LinearReg(LinearReg(C,13),11),7),5),3))
/16.326*100)/100 - (2.5*ATR(13))
,PREV)
,LinearReg(C,13))

 


RorPlot2

{ http://www.metastocktools.com }

Tperiod:=13;
CFlow:=100000;

If(
Sum(WC()*V,13) > CFlow
AND (LinearReg(WC(),13)
+LinearReg(LinearReg(WC(),8),13)
+LinearReg(LinearReg(LinearReg(WC(),5),8),13)
+LinearReg(LinearReg(LinearReg(LinearReg(WC(),3),5),8),13)
+LinearReg(LinearReg(LinearReg(LinearReg(LinearReg(WC(),2),3),5),8),13))/5
> (LinearReg(Ref(WC(),-1),13)
+LinearReg(LinearReg(Ref(WC(),-1),8),13)
+LinearReg(LinearReg(LinearReg(Ref(WC(),-1),5),8),13)
+LinearReg(LinearReg(LinearReg(LinearReg(Ref(WC(),-1),3),5),8),13)
+LinearReg(LinearReg(LinearReg(LinearReg(LinearReg(Ref(WC(),-1),2),3),5),8),13))/5
AND LLVBars(WC(),Tperiod) = Tperiod-1
AND PREV = 0
AND Mov(WC(),13,S) > Mov(WC(),21,S)
,Tperiod-1
,If(PREV > Tperiod-2
AND Mov(WC(),13,S) > Mov(WC(),21,S)
{AND Ref(Fml("RorPlot3"),-1) > 24} {Invalid circular reference!}
AND Fml("RorPlot1") >= Ref(Fml("RorPlot1"),-1)
,PREV+1
,If(Mov(WC(),21,S) >= Mov(WC(),13,S)
OR Sum(WC()*V,13) > CFlow
OR Ref(Fml("RorPlot1"),-1) > Fml("RorPlot1")
{OR Ref(Fml("RorPlot3"),-1) < 25} {Invalid circular reference!}
,0,PREV)))

 

 


RorPlot3

{ http://www.metastocktools.com }

Round(
If(Fml("RorPlot2")>0,
If(Fml("RorPlot2")<52,
(5200/(Fml("RorPlot2")+1))*((LinearReg(WC(),13)
{-Ref(WC(),-Fml("RorPlot2")) <--MS cannot handle variables in Ref function!}
-Ref(WC(),-20)) {<-- replaced with 20 period Ref function!}
/LinearReg(WC(),13)),
100*((LinearReg(WC(),13)-LinearReg(Ref(WC(),-51),13))/LinearReg(WC(),13))),
0))

 

Source / From: TOP
http://www.metastocktools.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!