Triple moving average filter

Forums ProRealTime English forum General trading discussions Triple moving average filter

Viewing 9 posts - 1 through 9 (of 9 total)
  • #229028

    hey all!

    I have tried to add a triple moving average filter to one of my systems.  The system only takes short positions on the DAX40 and I want the filter to allow trades when the moving averages are all below each other.  The basic code I am trying to use is:

    The isssue is this.  When I backtest the system appears to be taking orders when the moving averages are not below each other and trending downwards, as specified in the code.  In fact it is placing orders when the averages are all above each other, trending upwards!

    Can anyone help an idiot? Is the code not suffiecent to act as a triple moving average filter, or is something else going wrong?  I can happily post the code and the backtest results if it helps.

    Thanks

    Jim

     

     

    #229030

    Is your backtest results showing this …

    Put in a way different to what you say in your post … above is what your code is saying.

    1 user thanked author for this post.
    #229034

    Hi Grahal

    Thanks for the prompt reply! 🙂

    The backtest results show that it takes trades anywhere, regardless of the filter.  The system just doesn’t respect the filter.

    Not sure what is going on.  Having a few issues with V12. Maybe its a software issue?  Sometimes it does strange things when backtesting… not recognising variables in the optimiser window, etc.

     

    Jim

    #229036

    Jim, put this at the end of your code.

    Then you will probably see what GraHal means. I have the same “feeling”, but it depends on your m1, m2 and m3 and which is the smallest and which is the largest.
    You will see …

    #229037

    Hi Peter

    yes, of course.  These are the values, m1 the smallest always and m3 the largest always.

    m1 = 25, m2 = 45, m3 = 60

     

    #229038

    not recognising variables in the optimiser window, etc.

    I’ve experienced above also … well weird bug that is!
    Somehow though – and I can’t even say how – I’ve found a work-around as it hasd not happened to me for a few weeks, thankfully!

     

    #229056

    strange for sure….

    I just can’t figure out why the filter isn’t working and thought maybe it was a similar problem like a bug….

    #229061

    why the filter isn’t working

    A screenshot showing the filter not working might help us to suss out why.

    A snippet of code including how / where you use trendok might also help us to help you. 🙂

     

    #229332

    It works like a charm to me (as from attached pic), on both an indicator and a strategy.

    Strategy:

    indicator:

     

     

     

Viewing 9 posts - 1 through 9 (of 9 total)

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