3 versions of the Hull Average

Forums ProRealTime English forum ProOrder support 3 versions of the Hull Average

Viewing 15 posts - 1 through 15 (of 19 total)
  • #158362

    For the past year, before v11, I have been using this hard coded version of the Hull average:

    Now that it is built in to v11, it can be written as

    or

    As someone who uses this MA a lot, this should simplify my life. Except that they all give different results. The first image is the hard code, the second is hullaverage [20](typicalprice) and the third is average [20,8](typicalprice).

    I chose this algo for testing as it uses 3 instances of this MA. I would not conclude that the hard coded version (which was written by Vonasi, btw), is the ‘best’ — it probably gives the best result because the whole algo was designed around it. I’m only posting this to show that the 3 are not interchangeable. I was especially surprised to see such a difference between the 2 built-in versions, you’d really think they should be the same.

    If anyone’s interested, this is the original formula from Alan Hull’s website:

    Integer(SquareRoot(Period)) WMA [2 x Integer(Period/2) WMA(Price) – Period WMA(Price)]

    4 users thanked author for this post.
    #158369

    Have you created an indicator to compare them all directly? My platform is closed at the moment so I can’t test.

     

    1 user thanked author for this post.
    #158372

    I made copies of the algo. The first one has

    2nd

    3rd

    then similar for Hullb and Hullc

    #158379

    Re Vonasi code … on 5 min TF, 2 are the same value and 1 is different from the other 2 … see attached.

    #158388

    Interesting that the odd one out is average[20,8](typicalprice)

    You’d think that it and HullAverage[20](typicalPrice) would be the same.

    But they all look v close in that test, nothing like the variation I’m getting.

    #158391

    odd one out is average[20,8](typicalprice)

    where did you get 8 from?

    See attached, now unless v11 is different from v10.3  … Simple MS is 0 which makes Hull 7 and 8 is Zero Lag Exponential?

    Attached is from v11 btw

    1 user thanked author for this post.
    #158394

    Hahah and if we use 7 then all 3 Hulls show the same curve … see attached.

    #158397

    Arrggh! you’re right, I’m a numpty, 7 is Hull, not 8.

    Just ran another test, average[20,7] and HullAverage[20] are indeed the same. That’s a relief.

    But (unless I’ve made another stupid mistake somewhere) neither is anywhere close to Vonasi’s code that I had been using.

    Attached are the 2 test algos.

    #158401

    neither is anywhere close to Vonasi’s code that I had been using.

    I guess without the PRT code for average[20,7] and HullAverage[20]  … we’ll never know what the difference is?

    Which to use going forward eh??

    #158404

    I think I’ll stick with the coded version. There’s no optimization of any of the others (0-8) that get that result.

    #158405

    Hahah and if we use 7 then all 3 Hulls show the same curve

    Well spotted Grahal. I just assumed 8 was the hull average. Then again my hatred of lagging curve fitted averages of any kind leaves me a little inexperienced with them!

    #158406

    The difference could be starting points and the averages being calculated differently at barindex zero but I am only guessing. What are the compared results if you make the backtest start on a certain date well into the data sample?

    #158407

    running them both from June 2017 there’s a similar difference ~20%

    We might have to start calling this the Vonasi Moving Average.

    Looking at the Alan Hull formula, is (price) the same as (high+low+close)/3 ?

    #158411

    Borrowed description from elsewhere – ‘The Hull Moving Average uses two different weighted moving averages of price, plus a third WMA to smooth the raw moving average’. So the ‘price’ can be typical price, weighted price, total price or actual price. I stole the code from somewhere else so unless PRT stole it from the same place (or from me!) then I suspect Hull average is supposed to be calculated using typical price as they all agree on the returned value.

    At the end of the day whatever ‘price’ you use in the calculation matters very little – it s still an average that can be curve fitted so why not just use all Hull averages based on all possible price types and all possible periods until you find one that fits!

    1 user thanked author for this post.
    #158425

    BTW, average[20,8](typicalprice) and HullAverage[20](typicalPrice) should not be different, I’m going to ask the reason why!

Viewing 15 posts - 1 through 15 (of 19 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login