// Downloaded From https://www.WiseStockTrader.com
_SECTION_BEGIN("Background");
SetChartBkGradientFill( ParamColor("BgTop", colorBlack),ParamColor("BgBottom", colorBlack)); 
_SECTION_END();

_SECTION_BEGIN("AdvGetOsc");
//#### Created By Kelvinhand on 2016/Feb 17th ####
Osc_fast = Param("Osc.Fast", 5, 1, 35);
Osc_slow = Param("Osc.Slow", 35, 5, 35);
Osc_Color = ParamColor("Osc.Color", colorLightBlue);
MP=(H+L)/2;
OscAG=MA(MP,Osc_fast)-MA(MP,Osc_slow);
_SECTION_END();

_SECTION_BEGIN("Break Out Bands");
BOB_Upr = ParamColor("Upper", colorRed);
BOB_Lwr = ParamColor("Lower", colorLime);
BOB_Strength = Param("Strength(%)", 100, 1, 100);
_SECTION_END();


Lens=Osc_fast+Osc_slow;

for(i=0; i<Lens; i++)
UprLine[i] =LwrLine[i]= OscAG[i];

Pr = 2.0/Lens;

for(i=Lens; i<BarCount; i++)
{

   if (OscAG[i]>0)
   {
      UprLine[i] = OscAG[i]*pr+UprLine[i-1]*(1-pr);
      LwrLine[i] = LwrLine[i-1];
   }
   else
   {
      
      UprLine[i] = UprLine[i-1];
      LwrLine[i] = OscAG[i]*pr+LwrLine[i-1]*(1-pr);
   }
   

}

Plot(OscAG,"AdvGetOsc",Osc_Color,styleHistogram);
Plot(BOB_Strength/100*UprLine,"Upr",BOB_Upr,styleNoLabel);
Plot(BOB_Strength/100*LwrLine,"Lwr",BOB_Lwr,styleNoLabel);