Launch a virtual terminal and check out the advantages of the native hosting

Double Weighted Moving Average ... Missing?

Back to topics list To post a new topic, please log in or register
avatar
5
3827 2011.05.24 15:52
 

Hi All:

We have DEMA, TEMA, AMA and etc on MQL4 Code Base but not the Double Weighted Moving Average which I think is very useful as well.

Can someone shed some light on coding this Double Weighted Moving Average?

In addition to that, I not so sure about the calculation phase but is the Linear Weighted Moving Average on MetaTrader is the same as the common Weight Moving Average that we can found on other platforms such as Ninja and TradeStation? Can someone confirm on this?

Millions thanks in advance!

Regards,
James

 
USDJPY Technical Analysis 2015, 25.01 - 01.02: Bearish Ranging with possible Breakdown
D1 price is on primary bearish and secndary ranging ranging market condition: The price is located to be inside Ichimoku cloud/kumo for ranging market condition Sinkou Span A line (the border of Ichimoku cloud/kumo) is located above the price and very near to it for possible reversal which is indicating the primary bearish with secondary ranging Chinkou Span line is crissing the price from above to below on open D1 line for possible breakdown Nearest support level is 115.
avatar
5
3827 2011.05.25 08:27 #
 

Can anyone help?

TIA!

avatar
1816
SDC 2011.05.25 11:51 #
 
3827:

Hi All:

We have DEMA, TEMA, AMA and etc on MQL4 Code Base but not the Double Weighted Moving Average which I think is very useful as well.

Can someone shed some light on coding this Double Weighted Moving Average?

In addition to that, I not so sure about the calculation phase but is the Linear Weighted Moving Average on MetaTrader is the same as the common Weight Moving Average that we can found on other platforms such as Ninja and TradeStation? Can someone confirm on this?

Millions thanks in advance!

Regards,
James


I never heard about a double weighted moving average what is the formula for calculating a double weighted moving average ? Are you sure you are not talking about a double exponential moving average ? Also known as DEMA.
 
avatar
5
3827 2011.05.25 13:16 #
 

No, it is different than the DEMA.

It is the standard weighted moving average 'weighted' one more time. Pretty common in my trading circle.

TIA!

 
avatar
1816
SDC 2011.05.25 18:38 #
 

so is it an average of an average ?

avatar
5
3827 2011.05.25 19:53 #
 

Yes, just like DEMA. You average the EMA one more time. Double it. For TEMA, you average the DEMA one more time and make it 3 times in average.

For Double Weighted Moving Average, take the standard Weighted Moving Average and average it one more time with the same period/length.

Can you pls help?

Many TIA!

 
avatar
10198
WHRoeder 2011.05.25 21:36 #
 
lwmaBuf[]
dwmaBuf[]
...
double LWMA(double array[], int per, int bar)
{
   double Sum = 0;
   double Weight = 0;
   
   for(int i = 0;i < per;i++)
      { 
      Weight+= (per - i);
      Sum += array[bar+i]*(per - i);
      }
   if(Weight>0) double lwma = Sum/Weight;
   else lwma = 0; 
   return(lwma);
} 
start(){...
  for(...){
     lwmaBuf[shift] = LWMA(Close, MAperiod, shift);
     dwmaBuf[shift] = LWMA(lwmaBuf, MAperiod, shift);
  }

avatar
5
3827 2011.05.26 07:24 #
 

WHRoeder, pls pardon that my programming skill is poor. Can you post a full version of the code? Pls. Many thanks to you!

 
avatar
10198
WHRoeder 2011.05.26 18:25 #
 
Take ANY indicator and modify. No slaves here, learn to code or pay someone.
 
Back to topics list  

To add comments, please log in or register