Alan Hull's Rate of Return Indicator. Translated from TradeStation code by Jose Silva in 2000-2002. MetaStock -> Tools -> Indicator Builder -> New Copy and paste all formulae below. Plot only last formula. ======== RorPlot1 ======== ---8<--------------------------- { http://www.metastocktools.com } LR:=LinearReg(C,13); x:=Round((6.854*LR +4.236*LinearReg(LR,11) +2.618*LinearReg(LinearReg(LR,11),7) +1.618*LinearReg(LinearReg(LinearReg(LR,11),7),5)+LinearReg(LinearReg(LinearReg(LinearReg(LR,11),7),5),3))/16.326*100)/100; If(x>PREV,If(x-2.5*ATR(13)>PREV, x-2.5*ATR(13),PREV),LR) ---8<--------------------------- ======== RorPlot2 ======== ---8<--------------------------- { http://www.metastocktools.com } Tperiod:=13; CFlow:=100000; x:=Fml("RorPlot1"); 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 x>=Ref(x,-1) ,PREV+1 ,If(Mov(WC(),21,S)>=Mov(WC(),13,S) OR Sum(WC()*V,13)>CFlow OR Ref(x,-1)>x {OR Ref(Fml("RorPlot3"),-1) < 25} {Invalid circular reference!} ,0,PREV))) ---8<--------------------------- ======== RorPlot3 ======== ---8<--------------------------- { 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)) ---8<--------------------------- http://www.metastocktools.com