MetaStock code for RevEngEmaRsi {RevEng EMARSI} emaper:=Input("EMA Time Periods",1, 1000,45); WildPer:=Input("Wilder Time Periods",1, 100,14); ExpPer:=2*WildPer-1; value:=Mov(RSI(WildPer),emaper,E); {Average Up Close} AUC:=Mov( If(C>Ref(C,-1), C-Ref(C,-1), 0), ExpPer, E); {Average Down Close} ADC:=Mov( If(Ref(C,-1)>C, Ref(C,-1)-C, 0), ExpPer, E); x:=(WildPer-1)*(ADC*value/(100-value)-AUC); RevEngEMARSI:=If(x>=0, C+x, C+x*(100-value)/value); RevEngEMARSI MetaStock code for RevEngSmaRsi {RevEng SMARSI} smaper:=Input("SMA Time Periods",1, 1000,45); WildPer:=Input("Wilder Time Periods",1, 100,14); ExpPer:=2*WildPer-1; value:=Mov(RSI(WildPer),smaper-1,S); {Average Up Close} AUC:=Mov( If(C>Ref(C,-1), C-Ref(C,-1), 0), ExpPer, E); {Average Down Close} ADC:=Mov( If(Ref(C,-1)>C, Ref(C,-1)-C, 0), ExpPer, E); x:=(WildPer-1)*(ADC*value/(100-value)-AUC); RevEngSMARSI:=If(x>=0, C+x, C+x*(100-value)/value); RevEngSMARSI MetaStock code for RevEngTrendRsi {RevEngTrendRSI} RSIperiod:=14; day1:=Input("day for point 1",1, 32,1); month1:=Input("month for point 1",1, 12,1); year1:=Input("year for point 1",1900,3000 ,2001); day2:=Input("day for point 2",1, 32,1); month2:=Input("month for point 2",1, 12,1); year2:=Input("year for point 2",1900,3000 ,2001); ExpPer:=2*RSIperiod-1; date1:= day1= DayOfMonth() AND month1= Month() AND year1=Year(); date2:= day2= DayOfMonth() AND month2= Month() AND year2=Year(); I:= BarsSince(date1); J:= BarsSince(date2); RSI1:= ValueWhen(1 ,date1, RSI(RSIperiod)); RSI2:= ValueWhen(1 ,date2, RSI(RSIperiod)); {tomorrow's Trendline} value:= Min(Max((RSI2-RSI1)*(I+1)/(I-J)+RSI1, 1 ), 99); {Average Up Close} AUC:=Mov( If(C>Ref(C,-1), C-Ref(C,-1), 0), ExpPer, E); {Average Down Close} ADC:=Mov( If(Ref(C,-1)>C, Ref(C,-1)-C, 0), ExpPer, E); x:=(RSIperiod-1)*(ADC*value/(100-value)-AUC); RevEngTrendRSI:= If(x>=0, C+x, C+x*(100-value)/value); RevEngTrendRSI --Giorgos Siligardos |