std dev bands not showing correctly.

 

i am attempting to modify an indicator for MT4, by @Mladen Rakic I want to add std deviation lines to this modified atr-SMA, indicator. All help is appreciated.

mess 

Free download of the 'ATR adaptive SMA' indicator by 'mladen' for MetaTrader 4 in the MQL5 Code Base,

See my coding attempt attached. The image below is how my mess appears on the chart.

ATR adaptive SMA
ATR adaptive SMA
  • www.mql5.com
ATR adaptive SMA (Simple Moving Average)
Files: