HULL MA strategy orders lagging

Forums ProRealTime English forum ProOrder support HULL MA strategy orders lagging

Viewing 15 posts - 1 through 15 (of 21 total)
  • #115056

    Here’s a strange thing: code specifies changing direction after a change in the Hull17. Running on the FTSE it works as expected but on the DAX there tends to be a lag, so orders happen not on the next candle but after 2 candles … much less good. Looking at the screen shot, the Hull17 turns up at 11:20 so it should close the short and open long next candle @ 13285 … but instead this happens a candle later @ 13296. Any thoughts ?

    Here’s the code:

     

     

    #115059

    Just a though off the top of my head … what is it like if you run on a 2 min TF instead of 2.5 min TF??

    Have you tried looking at the values of Hull using … right click, Display , Cursor Details … maybe Hull is not turning up just when you think by looking at the Hull curve??

    1 user thanked author for this post.
    #115060

    I could try that, but generally I prefer 2.5m as a fast chart as it stays in synch with the more popular 5m and 15m. On the FTSE it works exactly as expected on the 2.5m

    #115061

    Try Cursor Details  … let us know how you get on please??

    #115062

    Cursor Details confirm an uptick of the Hull17, as does the colour change (pink to blue in the screen shot)

    #115066

    Sounds like a rounding issue of the period used for the Hull average.

    Add “graph hull” at the end of your code to compare the calculated HULL MA in ProBacktest to the one displayed on your chart.

    2 users thanked author for this post.
    #115121

    The ProBacktest graph gives slightly different values for HULL than the Prorealtime chart but registers the same change of direction at the same time.  I’ve just noticed the same problem with another script on DJI 15m – orders are executed on the third candle instead of  the second. Bigger problem when waiting another 15 minutes to open/close.

    #115122

    orders are executed on the third candle instead of  the second.

    This is worrying and we have had this brought up on here before  … very recently.

    For clarification, third candle means 2 candles after the candle which meet conditions to execute a trade?

    This is something that very few (if any except you) of us check for?? I know I don’t!

    If any reader does check this then please just say so on this Thread, then we will know this is NOT a widespread Issue??

    #115126

    For clarification, third candle means 2 candles after the candle which meet conditions to execute a trade?

    Yes. First candle shows the MA has changed direction, second should be the entry/exit, instead I’m getting the one after that … but only with DAX and DJI. FTSE behaves itself.

    V strange.

    1 user thanked author for this post.
    #115149

    The code is working correctly. Look at attached picture for a better understanding of what your code is doing.

    1. Code is read at Close of the bar, condition met, order is launched at next bar open.
    2. Your code is not testing changing of direction, but the slope of the Hull moving average (ascending or descending?). So orders could be launched in a middle of a long time formed “Hull trend”.

     

    1 user thanked author for this post.
    #115161

    nonetheless – I have changed your topic tile to something more meaningful. Please try to use titles that describe your topic rather than meaningless ones otherwise we will end up with forums full of ‘Help needed’ and ‘Code is not behaving’ topics.

    1 user thanked author for this post.
    #115166

    Hmm … that’s interesting. Not what I thought I had coded for. With the FTSE it acts upon a simple change of direction in the Hull MA rather than the slope. Or at least, I think it does! I’ll watch it a bit longer and see how it plays. Thanks again!

    #115170

    The conditions c1 and c2 are actually just testing if hull is superior (or inferior) to its last value, and not testing if it has changed from ascending to descending (making a top) and vice-versa (making a bottom).

     

    #115196

    The conditions c1 and c2 are actually just testing if hull is superior (or inferior) to its last value

    Yes, that is what I intended. And my expectation was that positions would enter/exit on the candle after that change.

    Otherwise the code would be c1 = hull > hull[2] no?

    #115198

    To test if Hull has made a Bottom or a Top (change of direction) would you not use Lowest or Highest over x periods?

    But I guess you want what you coded for!? 🙂

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

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