Home › Forums › CDC Forums › General Discussion — The Living Room › สูตร CDC RSI over bot-sold 20160516 › Reply To: สูตร CDC RSI over bot-sold 20160516
/*
{CDC RSI Over Bot/Sold 160516}
x1:=Mov(RSI(14),5,S);
x2:=OscP(12,26,E,%)<=-3 AND ROC(OscP(12,26,E,%),5,$)=-Sum(Abs(ROC(OscP(12,26,E,%),1,$)),5) OR (x1<=30);
x3:=x2 OR Ref(x2,-1) OR Ref(x2,-2) OR Ref(x2,-3) OR Ref(x2,-4);
x4:=OscP(12,26,E,%)>=3 AND ROC(OscP(12,26,E,%),5,$)=Sum(Abs(ROC(OscP(12,26,E,%),1,$)),5) OR (x1>=70);
x5:=x4 OR Ref(x4,-1) OR Ref(x4,-2) OR Ref(x4,-3) OR Ref(x4,-4);
x6:=BarsSince((x3=0 AND Ref(x3,-1)=1))>3 AND BarsSince((x3=0 AND Ref(x3,-1)=1))<11 AND C>Ref(HHV(C,3),-1);
x7:=BarsSince((x5=0 AND Ref(x5,-1)=1))>3 AND BarsSince((x5=0 AND Ref(x5,-1)=1))<11 AND C<Ref(LLV(C,3),-1);
x1; If(x3,20,30); If(x5,80,70); If(x6,40,48); If(x7,60,52); 30; 70;
*/
//SetChartOptions(0,chartShowArrows|chartShowDates);
GraphXSpace = 10;
// X1 = RSI.14 Smooth
x1 = MA( RSI( 14 ), 5 ) ;
// X2 = Over_Bot
x2 = OscP( 12, 26 ) <= -3 AND ROC( OscP( 12, 26 ), 5 ) == -Sum( Abs( ROC( OscP( 12, 26 ), 1 ) ), 5 )
OR( x1 <= 30 );
// X3 = OverBot 5 Days
x3 = x2 OR Ref( x2, -1 )
OR Ref( x2, -2 )
OR Ref( x2, -3 )
OR Ref( x2, -4 ) ;
// X4 = Over_Sold
x4 = OscP( 12, 26 ) >= 3 AND ROC( OscP( 12, 26 ), 5 ) == Sum( Abs( ROC( OscP( 12, 26 ), 1 ) ), 5 )
OR( x1 >= 70 ) ;
// X4 = OverSold 5 Days
x5 = x4 OR Ref( x4, -1 )
OR Ref( x4, -2 )
OR Ref( x4, -3 )
OR Ref( x4, -4 ) ;
// X6 = Buy
x6 = BarsSince( ( x3 == 0 AND Ref ( x3, -1 ) == 1 ) ) > 3 AND BarsSince ( ( x3 == 0 AND Ref( x3, -1 ) == 1 ) )<11
AND C > Ref( HHV( C, 3 ), -1 ) ;
// X6 = Sell
x7 = BarsSince( ( x5 == 0 AND Ref( x5, -1 ) == 1 ) ) > 3 AND BarsSince( ( x5 == 0 AND Ref( x5, -1 ) == 1 ) ) < 11
AND C < Ref( LLV( C, 3 ), -1 ) ;
Plot( RSI( 14 ) , “RSI.14” , colorGrey50 , styleLine ) ;
Plot( X1 , “MA.(RSI.14)” , colorYellow , styleLine ) ;
Plot( IIf( x3, 20, 30 ) , “X3” , colorGreen , styleLine | styleNoLabel | styleNoTitle) ;
Plot( IIf( x5, 80, 70 ) , “X5” , colorRed , styleLine | styleNoLabel | styleNoTitle) ;
PlotShapes ( shapeUpArrow*X6 , colorLime , 0 , X1 ) ;
PlotShapes ( shapeDownArrow*X7 , colorOrange , 0 , X1 ) ;
Plot( 30 , “” , colorWhite , styleDashed | styleNoLabel | styleNoTitle) ;
Plot( 50 , “” , colorWhite , styleDashed | styleNoLabel | styleNoTitle) ;
Plot( 70 , “” , colorWhite , styleDashed | styleNoLabel | styleNoTitle) ;