Hi
I’m trying to code the moving average indicator where I can then select the different type e.g. simple = 0, exponential = 1, etc. Why does it not work for type 7 = Zero Lag Exponential and type 8 = Hull? I have included variables a = Integer and b = MA type so that you can change these variables once indicator added to chart without having to modify the code.
Gives error as below:
Error in the indicator: MA TYPE (1 7)
Define the type of moving average
What am I doing wrong please?
Thanks
Sachin
period = a
type = b
MAHigh=Average[period,type](high)
MALow=Average[period,type](low)
return MAHIGH as "High", MALow as "Low"
v10.3 allows 0-6, v11 should allow up to 8 (I am not sure, though).
You can always hard code the missing indicators into your indicator.
The code for most popular average calculations can be found in this indicator.
Average Filter Regression
For info @sulimaster
Whenever I use Indicator Type 7 or 8 in a coded strategy it always works for me.
But I just tried in a stand alone Indicator (as above) and it gave me the error message etc.
ProBuilder and ProOrder use different engines hence there are sometimes differences to be found.