Stochastic

#1
Hello,

Setting Technical indicators is new to me. I Need TradeTiger Stoch setting in Amibroker

The current Stoch setting in trade tiger for me is (S 3,5,3), I need the same on Amibroker, but unable to find the indicator.

In amibroker there are indicators like Stochastic %D & Stochastic %K. I am confused which one to use to make them same as Trade tiger. Please help

THanks
 

XRAY27

Well-Known Member
#2
raahularyaji

Try this one and put the required values
_SECTION_BEGIN("stochastic");
GfxSetOverlayMode(1);
GfxSelectFont("Tahoma", Status("pxheight")/8 );
GfxSetTextAlign( 6 );// center alignment
GfxSetTextColor( ColorHSB( 42, 42, 42 ) );
GfxSetBkMode(0); // transparent
GfxTextOut( Name(), Status("pxwidth")/2, Status("pxheight")/12 );





/*************** remove all above lines for Amibroker 5.00 or less than 5



/**************************************************
Stochastics
***************************************************/

SP = Param( "Periods", 10, 1, 200, 1 );
Ksmooth = Param( "%K avg", 5, 1, 200, 1 );
Dsmooth = Param( "%D avg", 5, 1, 200, 1 );
StochDval = StochD( SP , Ksmooth, DSmooth );
StochKval = StochK( SP , Ksmooth);

Overbought = 80;
Oversold = 20;


Plot( StochD( SP , Ksmooth, DSmooth), _DEFAULT_NAME(), ParamColor( "ColorD", colorLavender ), ParamStyle("Style") );
Plot( StochK( SP , Ksmooth), _DEFAULT_NAME(), ParamColor( "ColorK", colorRed ), ParamStyle("Style") );

Plot(Overbought,"Overbought Level",colorRed);
Plot(Oversold,"Oversold Level",colorGreen);

StochBuy = Cross(StochK(SP,Ksmooth), StochD(SP,Ksmooth, DSmooth)) AND
(StochD(SP,Ksmooth, DSmooth) > 20) AND (StochK(SP,Ksmooth) > 20) AND
(StochD(SP,Ksmooth, DSmooth) < 80) AND (StochK(SP,Ksmooth) < 80);

StochSell = Cross (StochD(SP,Ksmooth, DSmooth), StochK(SP,Ksmooth)) AND
(StochD(SP,Ksmooth, DSmooth) > 20) AND (StochK(SP,Ksmooth) > 20) AND
(StochD(SP,Ksmooth, DSmooth) < 80) AND (StochK(SP,Ksmooth) < 80);

StochStrongBuy = Cross(StochK(SP,Ksmooth),StochD(SP,Ksmooth, DSmooth)) AND
(StochD(SP,Ksmooth, DSmooth) < 20) AND (StochK(SP,Ksmooth) < 20) ;

StochStrongSell = Cross (StochD(SP,Ksmooth,DSmooth), StochK(SP , Ksmooth));
(StochD(SP,Ksmooth, DSmooth) > 80) AND (StochK(SP,Ksmooth) > 80);

//****************** BULLISH / BEARISH *******************/
StochBull = StochK(SP , Ksmooth)>StochD(SP , Ksmooth, DSmooth) AND
(StochD(SP,Ksmooth, DSmooth) > 20) AND (StochK(SP,Ksmooth) > 20) AND
(StochD(SP,Ksmooth, DSmooth) < 80) AND (StochK(SP,Ksmooth) < 80);

StochBear = StochK(SP , Ksmooth)<StochD(SP , Ksmooth, DSmooth)AND
(StochD(SP,Ksmooth, DSmooth) > 20) AND (StochK(SP,Ksmooth) > 20) AND
(StochD(SP,Ksmooth, DSmooth) < 80) AND (StochK(SP,Ksmooth) < 80);


StochOB = (StochD(SP,Ksmooth, DSmooth) > 80) AND (StochK(SP,Ksmooth) > 80);
StochOS = (StochD(SP,Ksmooth, DSmooth) < 20) AND (StochK(SP,Ksmooth) < 20) ;

/****************************************************
CHART TITLES
****************************************************/



Title = EncodeColor(colorYellow)+ Title = Name() + " " + EncodeColor(2) + Date() + " "


/********************STOChASTICS*********************/
 
#4
Hi,

Try this one.

_SECTION_BEGIN( "Stoch KD Cloud" );

/*
Stochastic is an oscillator that measures the position of a stock OR security compared with its recent trading range indicating overbought OR oversold conditions.
It displays current Day price at a percentage relative to the securitys trading range (High/Low) over the specified period of time.
In a Slow Stochastic, the highs AND lows are averaged over a slowing period. The default is usually 3 for slow AND 1 (no slowing) for fast.
The line can then be smoothed using an exponential moving average, Weighted, OR simple moving average %D.
Confirming Buy/Sell signals can be read at intersections of the %D with the %K as well.

The Stochastic Oscillator always ranges between 0% AND 100%.
A reading of 0% shows that the securitys Close was the Lowest price that the security has traded during the preceding x-time periods.
A reading of 100% shows that the securitys Close was the Highest price that the security has traded during the preceding x-time periods.
When the closing price is near the top of the recent trading range (above 80%), the security is in an overbought condition AND may Signal for a possible correction.
Oversold condition exists at a point below %20. Prices Close near the top of the range during uptrends AND near the bottom of the range during downtrends.

Source: Amibroker 5.20 Help Menu

BUY = When the Stochastic is below the 20 oversold line AND the %K line crosses over the %D line.
SELL = When the Stochastic is above the 80 overbought line AND the %K line crosses below the %D line.

*/

periods = Param( "Periods", 15, 1, 200, 1 );
Ksmooth = Param( "%K Avg", 3, 1, 200, 1 );
a = StochK( periods , Ksmooth);
Plot( a, _DEFAULT_NAME(), ParamColor( "Color", colorBrightGreen ), ParamStyle("Style") );
Dsmooth = Param( "%D Avg", 3, 1, 200, 1 );
b = StochD( periods , Ksmooth, DSmooth );
Plot( b, _DEFAULT_NAME(), ParamColor( "Color", colorRed ), ParamStyle("Style") );

PlotOHLC( a,a,b,a,"", IIf(a>b, colorBrightGreen, colorRed), styleCloud);

Overbought= 80; Oversold= 20;
Plot(Overbought,"OB",colorRed);
Plot(Oversold,"OS",colorGreen);

Buy = Cross( a, b );
Sell = Cross( b, a );
PlotShapes( shapeSmallUpTriangle * Buy + shapeSmallDownTriangle * Sell, IIf( Buy, colorGold, colorRed ) );

_SECTION_END();

_SECTION_BEGIN("Animated_BackGround_");
// http://amibrokertraders.blogspot.com //
//====================

for( i = 1; i < BarCount; i++ )
z = (GetPerformanceCounter()/100)%256;
anim=ColorHSB( ( i + z ) % 256, 255, 100 );
SetChartBkColor(anim);
RequestTimedRefresh(1);

//====================
_SECTION_END();
 

Similar threads