@analyst2345 Welcome to the Forum! The way the site works, is that someone will submit the script and any questions that they have and everybody then chimes in with their thoughts.
So the script/code being discussed is the basic built-in TOS StochasticMomentumIndex to which the original poster added things like arrows. When you are reading a thread, it is always safe to start w/ the study in post#1. You can add it to your charts, get to understand it, google both this forum and the internet for the pros and the caveats of using this indicator. Then you can adapt that code w/ what others have contributed if you want to.
@cabe1332 turned the arrows into squares. You can make them anything you want by going to settings. @cab1332 also made pretty with some cloud coloring and a price bubble. Just in case, you are not yet well-versed in this type of formatting, Below is a script of the TOS SMI w/
@cabe1332's pretty formatting features. Review the code and read up in the TOS library because you can use these formatting features on any TOS or Custom study.
View attachment 750
Ruby:
# ########################################################
declare lower;
plot SMI = StochasticMomentumIndex()."SMI";
plot AvgSMI = StochasticMomentumIndex()."AvgSMI";
plot OverBought = 40;
plot OverSold = -40;
plot zeroline = 0 ;
zeroline.SetPaintingStrategy(PaintingStrategy.DASHES);
def signalUp = AvgSMI[1] < oversold and SMI[1] < AvgSMI[1] and SMI > AvgSMI;
def signalDn = AvgSMI[1] > overbought and SMI[1] > AvgSMI[1] and SMI < AvgSMI;
plot Up = if signalUp then AvgSMI else double.NaN ;
Up.SetPaintingStrategy(PaintingStrategy.SQUARES);
Up.SetDefaultColor(color.green) ;
Up.SetLineWeight(5);
plot Down = if signalDn then AvgSMI else double.NaN ;
Down.SetPaintingStrategy(PaintingStrategy.SQUARES);
Down.SetDefaultColor(color.red) ;
Down.SetLineWeight(5);
AddCloud(SMI, AvgSMI, color.light_green, color.pink);
AddChartBubble(signalUp, 0, close, Color.light_orange, no);
# ########################################################
Shared Study Link:
http://tos.mx/JY5P6yP Click here for -->
Easiest way to load shared links