TMA Bands - Non Repaint

 

Can someone help me find the non-repainting version of the attached TMA Centered Bands.

Thanks a lot.

Files:
TMA-MTF.mq4  10 kb
Capture.PNG  33 kb
 

Forum on trading, automated trading systems and testing trading strategies

Repaint Indicator

Mladen Rakic, 2017.03.22 09:01

T3 does not repaint

"snake" is same in values and method to centered TMA - recalculates : non repainting (end-pointed) version of centered TMA is LWMA

Centered SMA recalculates - non repainting (en-pointed) version of centered SMA is the "simple" SMA


 
Sergey Golubev:

Thanks - I am not sure I understood your response.


Is there another indicator called T3, or Snake, or LWMA TMA.


Can you kindly attach it or these?


Thank you.

 
You can find by yourself as there are a lot of indicators in the thread: https://www.mql5.com/en/forum/181241
or you can order in Freelance for example.
Triangular moving average (TMA) ...
Triangular moving average (TMA) ...
  • 2012.04.02
  • www.mql5.com
The purpose of this thread is more personal ... At some stage (some 4 years ago, posted it at this post : https://www.mql5...
 
Sergey Golubev:
You can find by yourself as there are a lot of indicators in the thread: https://www.mql5.com/en/forum/181241
or you can order in Freelance for example.

Thanks Sergey.


My TMA-MTF indicator has below code in it.


If i change the MODE_SMA to MODE_LWMA and recompile - does it become non-repaint?

Do i also need to change PRICE_CLOSE to PRICE_WEIGHTED?


PS - I changed MODE_SMA to MODE_LWMA - but it did not change the indicator on the chart. 


      for(i=limit; i>=0; i--)
        {
         double sum  = (HalfLength+1)*iMA(NULL,0,1,0,MODE_SMA,Price,i);
         double sumw = (HalfLength+1);

         for(j=1, k=HalfLength; j<=HalfLength; j++, k--)
           {
            sum  += k*iMA(NULL,0,1,0,MODE_SMA,MODE_CLOSE,i+j);
            sumw += k;

            if(j<=i)
              {
               sum  += k*iMA(NULL,0,1,0,MODE_SMA,MODE_CLOSE,i-j);
               sumw += k;
              }
           }
        // ...
        // ...
        }
 
JForex:

If i change the MODE_SMA to MODE_LWMA and recompile - does it become non-repaint?

Do i also need to change PRICE_CLOSE to PRICE_WEIGHTED?

No, if you modify it as shown below, it will be "no repaint".

However, it will appear shifted to the right like SMA, EMA, and others, so it is probably not suitable for your purpose.

It is impossible to make it "no repaint" while keeping the original position.

 if(calculateValue || timeFrame==Period())
     {
      for(i=limit; i>=0; i--)
        {
         double sum  = (HalfLength+1)*iMA(NULL,0,1,0,MODE_SMA,Price,i+HalfLength);
         double sumw = (HalfLength+1);

         for(j=1, k=HalfLength; j<=HalfLength; j++, k--)
           {
            sum  += k*iMA(NULL,0,1,0,MODE_SMA,Price,i+HalfLength+j);
            sumw += k;

            if(j<=i+HalfLength)
              {
               sum  += k*iMA(NULL,0,1,0,MODE_SMA,Price,i+HalfLength-j);
               sumw += k;
              }
           }
 

Can I ask - do you think this indicator I am attaching is repainting?


The thing is - its also MTF. Its possible the TMA indicator itself is not repainting. And rather, because its MTF - its repainting because of bar difference on lower timeframe.

Files:
TMA-MTF.mq4  10 kb
 
JForex:

Can I ask - do you think this indicator I am attaching is repainting?

The thing is - its also MTF. Its possible the TMA indicator itself is not repainting. And rather, because its MTF - its repainting because of bar difference on lower timeframe.

It repaints regardless of whether it is MTF or not, as it is calculating in the future direction.

sum  += k*iMA(NULL,0,1,0,MODE_SMA,MODE_CLOSE,i-j);
 
JForex:

Can I ask - do you think this indicator I am attaching is repainting?


The thing is - its also MTF. Its possible the TMA indicator itself is not repainting. And rather, because its MTF - its repainting because of bar difference on lower timeframe.

Centered TMA (and that indicator is centered TMA) is recalculating regardless if it is multi time frame or not

All that is needed to be known about it can be found here : https://www.mql5.com/en/forum/181241

Triangular moving average (TMA) ...
Triangular moving average (TMA) ...
  • 2012.04.02
  • www.mql5.com
The purpose of this thread is more personal ... At some stage (some 4 years ago, posted it at this post : https://www.mql5...
Reason: