// Downloaded From https://www.WiseStockTrader.com
/*
STEVE PRIMO - STRATEGY 3 --JS
with Pet - d and 25% bar up and down move with shapeUpArrow/shapeDownArrow
go long when you are "green" on top of the 50 sma or short "red" below the 50 sma
 
*/
_SECTION_BEGIN("JS");
basis = MA(C, 20);
dev = 0.382 * StDev(Close, 20);
upper = basis + dev;
lower = basis - dev;
bs = MA(C, 50);

// PET-D
petd = EMA(C,13);
petdcolor = IIf(C > petd , colorGreen, colorRed);
Plot(C,"",petdcolor ,styleCandle, styleBar | styleThick);

trendup = C > bs;
trenddn = C < bs;
 
Plot( bs, "Trend - Long Term", colorWhite, style = styleLine, width = 3 );
Plot (basis,"Bollinger Mid Line", colorRed, style = styleLine, width = 3);
 
Plot (upper,"Bollinger Upper Line", colorOrange, style = styleLine, width = 2);
Plot (lower,"Bollinger Lower Line", colorOrange, style = styleLine, width = 2);

 PlotOHLC( upper, upper, lower, lower, "", colorYellow,styleCloud );


R =(H-L);
 
PlotShapes( IIf( C > H-R*0.25, shapeUpArrow , shapeNone ), colorYellow );
PlotShapes( IIf( C < H -R*0.75 , shapeDownArrow, shapeNone ), colorOrange );

_SECTION_END();