Stochastic daily study for other time frames


0
0

Hey Pete,

I’ve been trying to get a stochasticslow indicator for daily time frame to work on my 15min chart.  Ive been playing with using data2 in the code to display the daily chart data that I have open within my 15min chart.  I’ve been succsessful at manipulating other indicators this way but have no luck with stochastic. I have attached the code below but the only thing I havechanged is adding data 2 to high low and close.  Please help.  Thanks!

inputs:
PriceH( High data2) [DisplayName = “PriceH”, ToolTip =
“Price High. Enter the High value to use in the Stochastics calculations.”],
PriceL( Low data2) [DisplayName = “PriceL”, ToolTip =
“Price Low. Enter the Low value to use in the Stochastics calculations.”],
PriceC( Close data2) [DisplayName = “PriceC”, ToolTip =
“Price Close. Enter the current price value to use in the Stochastics calculations.”],
StochLength( 10 ) [DisplayName = “StochLength”, ToolTip =
“Stochastic Length. Enter the length used in the stochastic calculations.”],
SmoothingLength1( 3 ) [DisplayName = “SmoothingLength1”, ToolTip =
“Enter number of bars to use in the moving average of the FastK values.”],
SmoothingLength2( 10 ) [DisplayName = “SmoothingLength2”, ToolTip =
“Enter number of bars to use in the moving average of the FastD values.”],
SmoothingType( 1 ) [DisplayName = “SmoothingType”, ToolTip =
“Enter the smoothing type to use. Enter 1 for Original (simple average), 2 for Legacy (exponential smoothing).”],
OverSold( 20 ) [DisplayName = “OverSold”, ToolTip =
“Enter the level of the indicator at which you consider the market to be oversold (too low).”],
OverBought( 80 ) [DisplayName = “OverBought”, ToolTip =
“Enter the level of the indicator at which you consider the market to be overbought (too high).”] ;

variables:
ReturnValue( 0 ),
oFastK( 0 ),
oFastD( 0 ),
oSlowK( 0 ),
oSlowD( 0 ) ;

ReturnValue = Stochastic( PriceH , PriceL , PriceC , StochLength, SmoothingLength1,
SmoothingLength2, SmoothingType, oFastK, oFastD, oSlowK, oSlowD ) ;

Plot1( oSlowK, !( “SlowK” ) ) ;
Plot2( oSlowD, !( “SlowD” ) ) ;
Plot3( OverBought, !( “OverBot” ) ) ;
Plot4( OverSold, !( “OverSld” ) ) ;

{ alert criteria }
if AlertEnabled and CurrentBar > 2 then
begin
{ CB > 2 check used to avoid spurious cross confirmation at CB = 2
(at CB = 1, MySlowK and MySlowD will be the same) }
if oSlowK crosses over oSlowD and oSlowK < OverSold then
Alert( !( “SlowK crossing over SlowD” ) )
else if oSlowK crosses under oSlowD and oSlowK > OverBought then
Alert( !( “SlowK crossing under SlowD” ) ) ;
end ;

Marked as spam
Posted by Pete Day (Questions: 5, Answers: 2)
Asked on January 19, 2020 3:13 pm
189 views
0
Private answer

I am guessing this sort of indicator may require a custom function to replace the standard Stochastic() function you are referencing. I spent as much time as I permit trying to find a quick and easy solution. I just can't spend the kind of time this requires in the Q&A forum.

Marked as spam
Posted by Pete Hahn (Questions: 37, Answers: 4153)
Answered on January 20, 2020 10:45 am
0
Did you stop making tradestation videos? I only see three on youtube. I really enjoyed the strategy video and was looking forward to the other videos you mentioned for some of the features mentioned in that video.
(Pete Day at January 20, 2020 11:56 am)
0
I still want to get back to those. I've been so very busy keeping up with this Q&A forum and building custom projects for folks. Most of the work I do is Thinkorswim these days.
(Pete Hahn at January 20, 2020 3:39 pm)