Need Multiple Time Frame For 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));


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);

///*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);

_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() ); 

Col_bar = IIf(EMA(CCI(14),2) > Ref(EMA(CCI(14),2),-1),colorBrightGreen,colorRed);


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);


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.

@sree I am sorry but I don’t understand what “MTF for TMA” stands for (may be my fault as I’m in Vegas tired and on my iPad).

You also have no commentary in your afl to explain what you are doing? I see Bollinger Band, ADX, CCI references but what are you attempting?

Lastly is there a question that you have? What is the question?

Or is this an example code that you are generously sharing with the community (and if so thank you for sharing).

1 Like

Thanks for your reply sir, i want multi time frame ( M T F ) indicator , i

want to see the TMA BANDS on higher time farme in plotting lower time

frame, which means , what are the tma values for 4 Hourly on 15 minute

chart …( seeing higher time frame values on lower time frame sir )

forget adx ,cci,bb all sir … JUST TMA bands are my main concern i want

plot upper time frame bands on lower time frame

hope its cleared now…

thanks alot in advance sir

So in that case, I guess that your last order was a huge take profit, not a stop-loss :sunglasses: :wink:

Enjoy your time in Vegas :star_struck:

1 Like

@Milosz Las Vegas can be so much fun, but I am getting too old and risk averse at the Blackjack tables and small bets resulted in small profits, (and just too old to experience the full possibilities of the night-life :frowning:️). Is there is something a little strange about me that I still check in on this forum while I’m on vacation :thinking: ?

@sree Forgive more questions, but no one has answered your post. What book or article are you getting a definition of your “TMA” (and by TMA do you mean Triangular Moving Average)? Maybe someone else can help you on this as I don’t understand your afl and don’t trade intra-day. I suspect you copied this from someone and have not written any of it yourself since you don’t want the CCI, ADX or Bollinger Bands.

I do no see any attempt in there at Multi-Time Frame indicators or charting.

You can begin by reviewing the examples and instructions here,

1 Like