WMA of variables
-
Hello,
I'm just curious if it's possible within FxDreema to make a WMA that operates using a variable rather than price. In this instance I want the WMA to calculate the average of a variable rather than the price over a given period.
In function I am trying to create a variation on a HMA but I am just wondering if FxDreema has this functionality
Pine equivalent would be "variable1 = wma(variable2, variable3)" with variable2 being the values averaged and variable3 being the time period.
Thank you for the help.
-
https://www.mql5.com/en/code/77
You need to import this library (using a custom block), then you can call the LinearWeightedMA() function on your variable, assuming its an array.
-
@roar Is this functional for mt4?
-
On mql4 its actually a bit easier, because you can use iMAOnArray() without importing anything: https://docs.mql4.com/indicators/imaonarray
So it would be something like this
https://fxdreema.com/shared/TUPEbGVXd -
@roar said in WMA of variables:
iMAOnArray()
Thank you for the help, so would this be functional?
https://fxdreema.com/shared/WxJFGiUod
Defining both values for variable2 and variable3 in different blocks then using them in the final WMA