Linear Weighted Moving Average

 

Any no where I can find a Linear Weighted Moving Average?

Thanks!

 

its option 3, LWMA, of the MAs in Metatrader

 

My Mom always saying...when can not find something...take a glass, turn it upside down and place it on the table...then it will come to you...

 

Want stand alone. Looking for code. So I can bring values into EA.

Thanks!

 
Yellowbeard:
Want stand alone. Looking for code. So I can bring values into EA. Thanks!

Use iMA() from the EA :

iMA

Calculates the Moving Average indicator and returns its value.

[TABLE] double iMA(

string symbol, // symbol

int timeframe, // timeframe

int ma_period, // MA averaging period

int ma_shift, // MA shift

int ma_method, // averaging method

int applied_price, // applied price

int shift // shift

);

[/TD]

[/TR]

[/TABLE]

Parameters

symbol

Symbol name on the data of which the indicator will be calculated. NULL means the current symbol.

timeframe

Timeframe. It can be any of ENUM_TIMEFRAMES enumeration values. 0 means the current chart timeframe.

ma_period

Averaging period for calculation.

ma_shift

MA shift. Indicators line offset relate to the chart by timeframe.

ma_method

Moving Average method. It can be any of ENUM_MA_METHOD enumeration values.

applied_price

Applied price. It can be any of ENUM_APPLIED_PRICE enumeration values.

shift

Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).

Returned value

Numerical value of the Moving Average indicator.

Example:

[TABLE]

[TR]

[TD] AlligatorJawsBuffer=iMA(NULL,0,13,8,MODE_SMMA,PRICE_MEDIAN,i);

[/TABLE]

use MODE_LWMA for the ma_method

Reason: