_SECTION_BEGIN("TMA");
HalfLength = Param("HalfLength", 61, 1, 999);
ATRPeriod = Param("ATRPeriod", 110,1,1000);
ATRMultiplier9 = Param("ATR Multiplier 9", 5.0);
cMidB = ParamColor("Mid Band", colorGreen);
cUprB = ParamColor("Upper Band", colorRed);
cLwrB = ParamColor("Lower Band", ColorRGB(30,144,255));
HalfLength=Max(HalfLength,1);
midBand = Null;
p = Close;
sma = MA(P, 1);
iatr= ATR(ATRPeriod);
iLmt = BarCount-1 - (HalfLength);
for (i=0; i<BarCount; i++)
{
dSum = (HalfLength+1)* sma[i];
sumw = (HalfLength+1);
for(j=1, k=HalfLength; j<=HalfLength; j++, k--)
{
if(i+j>=BarCount) break;
dSum += k* sma[i+j];
sumw += k;
if (j<=i)
{
dSum += k*sma[i-j];
sumw += k;
}
}
MidBand[i] = dSum/sumw;
}
UprBand9 = MidBand+iATR*ATRMultiplier9;
LwrBand9 = MidBand-iATR*ATRMultiplier9;
Plot(MidBand, "MidBand", cMidB, styleNoLabel|styleNoTitle);
Plot(UprBand9, "UprBand9", cUprB, styleNoLabel|styleNoTitle|styleStaircase);
Plot(LwrBand9, "LwrBand9", cLwrB, styleNoLabel|styleNoTitle|styleStaircase);
_SECTION_END();
///*Plot Ribbon */
Ribbon1=IIf( EMA( Close , 7 )>EMA( Close , 21 ) ,colorGreen, IIf(EMA( Close , 34 )>EMA( Close , 8 ), colorRed,colorYellow));
//Plot(6, "Ribbon", Ribbon1, styleOwnScale| styleArea| styleNoLabel,-0.5,100);
_SECTION_END();
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();
_SECTION_BEGIN("ADX");
Col_bar = IIf(EMA(CCI(14),2) > Ref(EMA(CCI(14),2),-1),colorBrightGreen,colorRed);
Plot(Close,"price",col_bar,styleCandle);
_SECTION_END();
_SECTION_BEGIN("BB");
bb2top = BBandTop(Close,20,2.25);
bb1top = BBandTop(Close,20,1);
bb2bot = BBandBot(Close,20,2.25);
bb1bot = BBandBot(Close,20,1);
//Plot (bb2top,"",IIf(bb2top > Ref(bb2top,-1) AND bb2bot < Ref(bb2bot,-1),colorBlue,colorGrey40),styleNoLabel);
//Plot (bb2bot,"",IIf(bb2top > Ref(bb2top,-1) AND bb2bot < Ref(bb2bot,-1),colorBlue,colorGrey40),styleNoLabel);
//PlotOHLC(bb2top,bb2top,bb1top,bb1top,"",colorDarkGrey,styleCloud);
//PlotOHLC(bb1bot,bb1bot,bb2bot,bb1bot,"",colorDarkGrey,styleCloud);
Moderator comment: Read "How to use this site!" BEFORE POSTING and follow the rules. You forgot using code tags and I had to add them again.