Support Board
Date/Time: Wed, 15 May 2024 12:53:31 +0000
Post From: Native Premier Stochastics Request
[2021-01-31 00:28:50] |
cmet - Posts: 538 |
If any Sierrachart custom coders can make a proper version of this using the Sierrachart InputData set, please message me with cost/time to complete. Easily one of the best versions of Stochastics out there. Code from above article: Indicator: PremierStochasticRS
inputs: Line1( 0.9 ), Line2( 0.2 ), StochLength( 8 ), Period( 25 ), ColorPremier( Yellow ), ColorLine1( Magenta ), ColorLine2( Red ), ColorLine3( DarkGreen ), ColorLine4( Green ) , TextColor1( White ), TextColor2( White ), TextColor3( White ), TextColor4( Black ) ; variables: DummyVar( 0 ), oFastK( 0 ), oFastD( 0 ), oSlowK( 0 ), oSlowD( 0 ), Length( 0 ), NormStoch( 0 ), SmoothStoch( 0 ), eValue( 0 ), Premier( 0 ) ; DummyVar = Stochastic( High, Low, Close, StochLength, 1, 3, 1, oFastK, oFastD, oSlowK, oSlowD ) ; Length = iff( Period < 0, 1, SquareRoot( Period ) ) ; NormStoch = 0.1 * ( oSlowK - 50 ) ; SmoothStoch = XAverage( XAverage( NormStoch, Length ), Length ) ; eValue = ExpValue( SmoothStoch ) ; Premier = ( eValue - 1 ) / ( eValue + 1 ) ; Plot1( Premier, "Premier" ) ; if Premier crosses over Line1 then begin SetPlotBGColor( 1, ColorLine1 ) ; SetPlotColor( 1, TextColor1 ) ; end else if Premier crosses over Line2 then begin SetPlotBGColor( 1, ColorLine2 ) ; SetPlotColor( 1, TextColor2 ) ; end else if Premier crosses under -Line1 then begin SetPlotBGColor( 1, ColorLine3 ) ; SetPlotColor( 1, TextColor3 ) ; end else if Premier crosses under -Line2 then begin SetPlotBGColor( 1, ColorLine4 ) ; SetPlotColor( 1, TextColor4 ) ; end ; |