Erratum, it is 7 and not 8 and they are together the same.
return average[20,7](typicalprice),HullAverage[20](typicalPrice)
The difference with the coded version could come from the rounding of the period.
Predefined MM HULL (20 periods) uses TYPICALPRICE and matches exactly my two custom indicators:
Period = 20
src = CustomClose
x1 = WeightedAverage[Period](src)
x2 = (2 * WeightedAverage[round(Period/2)](src)) - x1
HullMA = WeightedAverage[round(sqrt(Period))](x2)
RETURN HullMA
p = 20
RETURN average[p,7](TypicalPrice)
Predefined HULL MOVING AVERAGE (20 periods) uses CLOSE , so it cannot match the other two. If you use CLOSE also with the other predefined MM HULL (and custom ones) they will match.
The difference is not due to rounding.
does CustomClose not need to be defined?
Using CustomClose implies the properties to ask users what price they want the indicator to be applied to (a dropdown list will allow you to select Close, Low, High, Open, TypicalPrice. MedianPrice, ….).