Moving AveragesMoving Average indicators for MT4

1
Moving Average Indicators for Metatrader 4

Latest version of the non-repainting "Averages" indicator by Mladen 🆕
26 May 2022 Averages 9.6 for MT4

What are All Averages filters for Metatrader?
21 March 2022 Guide to the All Averages MA filters

Example: Moving Averages shown on a ProRealTime Chart


This is the newest version of averages
 

For those that want to use if from custom calls, here is the enum for prices, averages types and time frames

Code: Select all

enum enPrices
{
   pr_close,      // Close
   pr_open,       // Open
   pr_high,       // High
   pr_low,        // Low
   pr_median,     // Median
   pr_typical,    // Typical
   pr_weighted,   // Weighted
   pr_average,    // Average (high+low+open+close)/4
   pr_medianb,    // Average median body (open+close)/2
   pr_tbiased,    // Trend biased price
   pr_tbiased2,   // Trend biased (extreme) price
   pr_haclose,    // Heiken ashi close
   pr_haopen ,    // Heiken ashi open
   pr_hahigh,     // Heiken ashi high
   pr_halow,      // Heiken ashi low
   pr_hamedian,   // Heiken ashi median
   pr_hatypical,  // Heiken ashi typical
   pr_haweighted, // Heiken ashi weighted
   pr_haaverage,  // Heiken ashi average
   pr_hamedianb,  // Heiken ashi median body
   pr_hatbiased,  // Heiken ashi trend biased price
   pr_hatbiased2  // Heiken ashi trend biased (extreme) price
};
enum enMaTypes
{
   ma_adxvma,  // Adxvma
   ma_ahr,     // Ahrens moving average
   ma_alxma,   // Alexander moving average - ALXMA
   ma_dema,    // Double exponential moving average - DEMA
   ma_dsema,   // Double smoothed exponential moving average - DSEMA
   ma_emas,    // Ema derivative - EMAD
   ma_ema,     // Exponential moving average - EMA
   ma_frama,   // Fractal adaptive moving average - FRAMA
   ma_hull,    // Hull moving average - HMA
   ma_ie2,     // IE/2
   ma_ilinr,   // Integral of linear regression slope
   ma_itl,     // Instantaneous trendline
   ma_lagg,    // Laguerre filter
   ma_lead,    // Leader exponential moving average
   ma_linr,    // Linear regression value - LSMA
   ma_lwma,    // Linear weighted moving average - LWMA
   ma_mcg,     // McGinley Dynamic
   ma_mcma,    // McNicholl ema
   ma_nlma,    // Non lag moving average
   ma_pwma,    // Parabolic weighted moving average - PWMA
   ma_rmta,    // Recursive moving trendline - RMTA
   ma_sma,     // Simple moving average - SMA
   ma_sid,     // Simple decycler - SDEC
   ma_sine,    // Sine weighted moving average
   ma_smma,    // Smoothed moving average - SMMA
   ma_smoo,    // Smoother
   ma_ssm,     // Super smoother
   ma_b3p,     // Three pole Ehlers Butterworth
   ma_s3p,     // Three pole Ehlers smoother
   ma_tma,     // Triangular moving average - TMA
   ma_tema,    // Tripple exponential moving average - TEMA
   ma_b2p,     // Two pole Ehlers Butterworth
   ma_s2p,     // Two pole Ehlers smoother
   ma_vema,    // Volume weighted ema - VEMA
   ma_vwma,    // Volume weighted moving average - VWMA
   ma_zldema,  // Zero lag dema
   ma_zlma,    // Zero lag moving average
   ma_zltema   // Zero lag tema
};
enum enTimeFrames
{
   tf_cu  = 0,              // Current time frame
   tf_m1  = PERIOD_M1,      // 1 minute
   tf_m5  = PERIOD_M5,      // 5 minutes
   tf_m15 = PERIOD_M15,     // 15 minutes
   tf_m30 = PERIOD_M30,     // 30 minutes
   tf_h1  = PERIOD_H1,      // 1 hour
   tf_h4  = PERIOD_H4,      // 4 hours
   tf_d1  = PERIOD_D1,      // Daily
   tf_w1  = PERIOD_W1,      // Weekly
   tf_mb1 = PERIOD_MN1,     // Monthly
   tf_cus = 12345678        // Custom time frame
};
These users thanked the author mladen for the post (total 10):
navid110, BenOscar, fxchampion, pipmagnet, 太虚一毫, Thangarasu, Jedidiah, tc1688, warytrader, macd & rsi


Re: Moving Average indicators for MT4

2
mladen wrote:This is the newest version of averages

 

For those that want to use if from custom calls, here is the enum for prices, averages types and time frames

Code: Select all

enum enPrices
{
   pr_close,      // Close
   pr_open,       // Open
   pr_high,       // High
   pr_low,        // Low
   pr_median,     // Median
   pr_typical,    // Typical
   pr_weighted,   // Weighted
   pr_average,    // Average (high+low+open+close)/4
   pr_medianb,    // Average median body (open+close)/2
   pr_tbiased,    // Trend biased price
   pr_tbiased2,   // Trend biased (extreme) price
   pr_haclose,    // Heiken ashi close
   pr_haopen ,    // Heiken ashi open
   pr_hahigh,     // Heiken ashi high
   pr_halow,      // Heiken ashi low
   pr_hamedian,   // Heiken ashi median
   pr_hatypical,  // Heiken ashi typical
   pr_haweighted, // Heiken ashi weighted
   pr_haaverage,  // Heiken ashi average
   pr_hamedianb,  // Heiken ashi median body
   pr_hatbiased,  // Heiken ashi trend biased price
   pr_hatbiased2  // Heiken ashi trend biased (extreme) price
};
enum enMaTypes
{
   ma_adxvma,  // Adxvma
   ma_ahr,     // Ahrens moving average
   ma_alxma,   // Alexander moving average - ALXMA
   ma_dema,    // Double exponential moving average - DEMA
   ma_dsema,   // Double smoothed exponential moving average - DSEMA
   ma_emas,    // Ema derivative - EMAD
   ma_ema,     // Exponential moving average - EMA
   ma_frama,   // Fractal adaptive moving average - FRAMA
   ma_hull,    // Hull moving average - HMA
   ma_ie2,     // IE/2
   ma_ilinr,   // Integral of linear regression slope
   ma_itl,     // Instantaneous trendline
   ma_lagg,    // Laguerre filter
   ma_lead,    // Leader exponential moving average
   ma_linr,    // Linear regression value - LSMA
   ma_lwma,    // Linear weighted moving average - LWMA
   ma_mcg,     // McGinley Dynamic
   ma_mcma,    // McNicholl ema
   ma_nlma,    // Non lag moving average
   ma_pwma,    // Parabolic weighted moving average - PWMA
   ma_rmta,    // Recursive moving trendline - RMTA
   ma_sma,     // Simple moving average - SMA
   ma_sid,     // Simple decycler - SDEC
   ma_sine,    // Sine weighted moving average
   ma_smma,    // Smoothed moving average - SMMA
   ma_smoo,    // Smoother
   ma_ssm,     // Super smoother
   ma_b3p,     // Three pole Ehlers Butterworth
   ma_s3p,     // Three pole Ehlers smoother
   ma_tma,     // Triangular moving average - TMA
   ma_tema,    // Tripple exponential moving average - TEMA
   ma_b2p,     // Two pole Ehlers Butterworth
   ma_s2p,     // Two pole Ehlers smoother
   ma_vema,    // Volume weighted ema - VEMA
   ma_vwma,    // Volume weighted moving average - VWMA
   ma_zldema,  // Zero lag dema
   ma_zlma,    // Zero lag moving average
   ma_zltema   // Zero lag tema
};
enum enTimeFrames
{
   tf_cu  = 0,              // Current time frame
   tf_m1  = PERIOD_M1,      // 1 minute
   tf_m5  = PERIOD_M5,      // 5 minutes
   tf_m15 = PERIOD_M15,     // 15 minutes
   tf_m30 = PERIOD_M30,     // 30 minutes
   tf_h1  = PERIOD_H1,      // 1 hour
   tf_h4  = PERIOD_H4,      // 4 hours
   tf_d1  = PERIOD_D1,      // Daily
   tf_w1  = PERIOD_W1,      // Weekly
   tf_mb1 = PERIOD_MN1,     // Monthly
   tf_cus = 12345678        // Custom time frame
}; 
Dearest MLADEN
Really a pretty addition in Averages ..... along with very in demand (Averages methods,TF,prices) code snippet for EA lovers,since the code snippet was in tsd there were 19 averages method and 20 prices,now increased/expand to 22 prices and 38 averages methods.
it seems things are completely changed,so kind of you
regards
These users thanked the author mntiwana for the post (total 3):
pipmagnet, Wolfgang, tc1688
Indicator is just a tool.

Use it only if it can benefit you. Leave it if you don't know how to use it optimally.


Re: Moving Average indicators for MT4

7
Krelian99 wrote:So many moving averages... and prices...
Is the custom tf what is new?
More internal : the new way of multi time frame handling (single instance mtf instead of adding two instances of indicator when in multi time frame, lighter on CPU that way) and some more stuff that makes the indicator more efficient

Re: Moving Average indicators for MT4

9
Dearest  Mr. Mladen,Congrats for You and for All for this new forum. It’s great there is a new place with so much good people, energy and new ideas.I’m sorry to ask again and bother You in such a busy time but I would like to ask are there any chances to add all this above listed types of averages  to Your great work:BB stops (new format) 1.1 for MT4 Once again thank You for Your time.All the best and with best regards

Re: Moving Average indicators for MT4

10
Kyo wrote:Dearest  Mr. Mladen,Congrats for You and for All for this new forum. It’s great there is a new place with so much good people, energy and new ideas.I’m sorry to ask again and bother You in such a busy time but I would like to ask are there any chances to add all this above listed types of averages  to Your great work:BB stops (new format) 1.1 for MT4 Once again thank You for Your time.All the best and with best regards
Here is this version - it has all the 38 types of averages included. it is multi time frame and it has the usual set of alerts added
These users thanked the author mladen for the post (total 4):
太虚一毫, Jedidiah, macd & rsi, RodrigoRT7


Who is online

Users browsing this forum: 256robertm, Bing [Bot], ChatGPT [Bot], fxgman, fxmoney, Majestic-12 [Bot], MetaStorm, phnthnhnm, Steam1 and 52 guests