Hi,
Please could you help me with the below formula.
I don't know anything about coding. I tried to do some experiment. I tried to add buy sell signals to formula of Stochastic %D. But I am not getting the results.
The condition is
Buy when %D crosses Oversold line from below
Sell when %D crosses Overbought line from above
_SECTION_BEGIN("Stochastic %D");
periods = Param( "Periods", 15, 1, 200, 1 );
Ksmooth = Param( "%K avg", 3, 1, 200, 1 );
Dsmooth = Param( "%D avg", 3, 1, 200, 1 );
Plot( StochD( periods , Ksmooth, DSmooth ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
Overbought= 80; Oversold= 20;
Plot(Overbought,"OB",colorRed);
Plot(Oversold,"OS",colorGreen);
Buy = Cross(DSmooth, Oversold ) ;
Sell = Cross( Overbought, DSmooth );
PlotShapes( shapeSmallUpTriangle * Buy + shapeSmallDownTriangle * Sell, IIf( Buy, colorGold, colorRed ) );
_SECTION_END();
Thanks.
Please could you help me with the below formula.
I don't know anything about coding. I tried to do some experiment. I tried to add buy sell signals to formula of Stochastic %D. But I am not getting the results.
The condition is
Buy when %D crosses Oversold line from below
Sell when %D crosses Overbought line from above
_SECTION_BEGIN("Stochastic %D");
periods = Param( "Periods", 15, 1, 200, 1 );
Ksmooth = Param( "%K avg", 3, 1, 200, 1 );
Dsmooth = Param( "%D avg", 3, 1, 200, 1 );
Plot( StochD( periods , Ksmooth, DSmooth ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
Overbought= 80; Oversold= 20;
Plot(Overbought,"OB",colorRed);
Plot(Oversold,"OS",colorGreen);
Buy = Cross(DSmooth, Oversold ) ;
Sell = Cross( Overbought, DSmooth );
PlotShapes( shapeSmallUpTriangle * Buy + shapeSmallDownTriangle * Sell, IIf( Buy, colorGold, colorRed ) );
_SECTION_END();
Thanks.