Creating A Stochastic BASED ON RSI • Pine Script [OUTDATED V4] Tutorial
hi traders my name is Matthew from pine
script mastery calm and in today's video
I'm going to show you how to calculate
the stochastic indicator based on RSI
values so this is kind of an extension
to the previous video I released where I
showed you how to draw the stochastic
indicator and the RSI indicator into the
same oscillator box so ever open up the
source code to this script if you
watched that previous video this should
all look familiar to you so before we
begin I just notice here that the
overbought and oversold levels for zoom
right in here you can see that they're
actually drawing over the top of our
stochastic in RSI drawings if you want
to change the order of your drawing
plots so that your overbought and
oversold lines drawing beneath these
values you can just move them down here
so if I cut control X cut these out of
them paste them at the top and then we
save the scripts you can see now that
the indicator values are drawing over
the top of the overbought and oversold
thresholds but anyway that's just a
tidbit of information for you let's get
into this lesson so what we're going to
do here it's pretty easy actually to
change the stochastic to calculate based
on RSI data all we need to do is change
our price data variables to reference
the RSI so I'm simply going to copy the
RSI value here and paste it over the top
of all of our price action variables so
now when I save the script our K is
going to be calculated as a result of a
hundred multiplied by the RSI value
minus the lowest low over the past 14
bars by default you can change this in
the settings menu and then it's going to
be divided by the highest RSI value over
that same look-back period minus the
lowest RSI value over that look-back
period and this will give us a value
between zero and 100 and we'll be
calculating the stochastic based on our
side values very simple so that save the
script and watch the magic happen there
we go now notice that these stochastic
has a lot more swings in it because it's
been calculated based on the RSI instead
of price action and that's it that's all
we need to
in order to calculate the stochastic
based on the RSI value I hope you found
this lesson interesting and helpful if
you did and you want to learn more head
over to pine basics comm and you'll get
access to my free pain Script course
which covers the basics of pine script
in detail I also have a mastery course
over there that goes into a lot more
detail than the basics course but if you
need a pine script the basics course is
a great place to start obviously and
it's free so that's it for this lesson
I'll see you in the next one
[Music]
No comments:
Post a Comment