I'm having trouble trying figure out why my indicator doesn't fit into overbought/oversold like the indicator in the other image.

Can someone help me out? Script is below, I basically added some code to standard TOS slow Stochastics indicator. Also from the image is there a way that I can smooth out the lines?

@MerryDay
declare lower;

input agg = AggregationPeriod.FOUR_DAYS;

input over_bought = 80;

input over_sold = 20;

input Zeroline = 50;

input KPeriod = 12;

input DPeriod = 3;

def priceH = high;

def priceL = low;

def priceC = close;

input averageType = AverageType.SIMPLE;

input showBreakoutSignals = {default "No", "On SlowK", "On SlowD", "On SlowK & SlowD"};

plot SlowK = reference StochasticFull(over_bought,over_sold,KPeriod,DPeriod,priceH,priceL,priceC,3,averageType).FullK;

plot SlowD = reference StochasticFull(over_bought,over_sold,KPeriod,DPeriod,priceH,priceL,priceC,3,averageType).FullD;

plot OverBought = over_bought;

plot OverSold = over_sold;

plot zerobase = zeroline;

def upK = SlowK crosses above OverSold;

def upD = SlowD crosses above OverSold;

def downK = SlowK crosses below OverBought;

def downD = SlowD crosses below OverBought;

plot UpSignal;

plot DownSignal;

switch (showBreakoutSignals) {

case "No":

UpSignal = Double.NaN;

DownSignal = Double.NaN;

case "On SlowK":

UpSignal = if upK then OverSold else Double.NaN;

DownSignal = if downK then OverBought else Double.NaN;

case "On SlowD":

UpSignal = if upD then OverSold else Double.NaN;

DownSignal = if downD then OverBought else Double.NaN;

case "On SlowK & SlowD":

UpSignal = if upK or upD then OverSold else Double.NaN;

DownSignal = if downK or downD then OverBought else Double.NaN;

}

UpSignal.setHiding(showBreakoutSignals == showBreakoutSignals."No");

DownSignal.setHiding(showBreakoutSignals == showBreakoutSignals."No");

SlowK.setDefaultColor(GetColor(5));

SlowD.setDefaultColor(GetColor(0));

OverBought.SetDefaultColor(GetColor(1));

OverSold.SetDefaultColor(GetColor(1));

UpSignal.SetDefaultColor(Color.UPTICK);

UpSignal.SetPaintingStrategy(PaintingStrategy.ARROW_UP);

DownSignal.SetDefaultColor(Color.DOWNTICK);

DownSignal.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);