Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Inverse Distance Weighted Moving Average (IDWma) - MetaTrader 4 Script - MT4/MT5 Resources

author EAcpu | 2 reads | 0 comments |

Inverse Distance Weighted Moving Average (IDWma) - indicator for MetaTrader 4

This multi-timeframe moving average moves price away from the average. It is smoother than the SMA but follows similar prices to the EMA of the same length.

I came across en.wikipedia.org/wiki/Distance-weighted_estimator , thought it might be useful and coded it.

It does have some overshoot and initial lag like the SMA, but is much closer to price than the corresponding EMA. Initial lag can be useful when trailing stops and market direction reversals.

There are four (4) parameters, the first three are the same as the Standard Moving Average

 outer integer MA_period = 14 ; // default moving average
External integer MA_Shift= 0 ; //Default moving average
External integer MA_Price = 0 ; // PRICE_CLOSE=0, Open=1, Highest price=2, Lowest price=3, Median=4, Typical value=5, Weight=6
external integer MA_TF = 0 ; // chart = 0, PERIOD_H1... 

Inverse Distance Weighted Moving Average (IDWma) - indicator for MetaTrader 4


Attachment download

📎 IDWma.mq4 (5.34 KB)

Source: MQL5 #10627

Verification code Refresh