MetaStock Code for StockRSI for "Developing A Trading System" by Scholten

SCaug02adjust periods:=  14;
StochRSI:=(RSI(periods)-LLV(RSI(periods),periods))/
   (HHV(RSI(periods),periods)-LLV(RSI(periods),periods));
rdp1:= Round(Stdev( StochRSI,60)/.053);
rdp2:= Round(Stdev(  StochRSI,60)/.035);
rdv1:=  Round(Stdev(Mov(V,14,S)/1000000,60));
adjust:=rdv1-rdp1+11;
adjust1:=If(adjust<8,8,If(adjust>12,12,adjust))
   SCaug02StochRSIdyn adj1:=(RSI(8)-LLV(RSI(8),8))/(HHV(RSI(8),8)-LLV(RSI(8),8));
adj2:=(RSI(9)-LLV(RSI(9),9))/(HHV(RSI(9),9)-LLV(RSI(9),9));
adj3:=(RSI(10)-LLV(RSI(10),10))/(HHV(RSI(10),10)-LLV(RSI(10),10));
adj4:=(RSI(11)-LLV(RSI(11),11))/(HHV(RSI(11),11)-LLV(RSI(11),11));
adj5:=(RSI(12)-LLV(RSI(12),12))/(HHV(RSI(12),12)-LLV(RSI(12),12));
StochRSIdyn:=
   If( FmlVar("SCaug02adjust","adjust1")=8,adj1,
   If(FmlVar("SCaug02adjust","adjust1")=9,adj2,
   If(FmlVar("SCaug02adjust","adjust1")=10,adj3,
   If(FmlVar("SCaug02adjust","adjust1")=11,adj4,adj5))));
StochRSIdyn