Dynamic Zone Elasticity, division by zero

Forums ProRealTime English forum ProOrder support Dynamic Zone Elasticity, division by zero

Viewing 15 posts - 1 through 15 (of 58 total)
  • #156865

    I’ve got an algo in demo using this indicator which takes trades but gets stopped every few days for division by zero. Everything else is pieces of code I’ve been using for ages so I assume the problem is with Dynamic Zone Elasticity. Anyone else with experience of this? Shall I post the whole algo?

     

    #156880

    The only possible division by a zero value is contained at line 12 with the variable x. However, it should not be a zero value. What is the timeframe used please?

    #156885

    Thanks Nicolas, it runs on a 1 minute TF. This is the whole thing, if that helps:

     

    #156886

    I’m also using it in a 2 min algo with a similar combination of indicators where it runs with no problem.

    #156889

    I had the same problem with this indicator. I have 2 strategies based on it, one works fine but the other gets the zero division error. I can only assume the problem is not with the indicator.

    Try putting

    ONCE period and ONCE smoothing

    1 user thanked author for this post.
    #156975

    @Monochrome, it’s made 2 trades today with that change – so far so good. thanks again.

    #156980

    No problem. I too have tried a similar strategy with supertrend. I have shelved it long back and moved on,  hoping to revisit it sometime again. It stills gets the zero division error but i think its due to the <> and = use.

    This strategy uses no optimisation, (I personally hate optimisation). I like its entries but needs work on the exits.

    I share this here (code is very messy). I think dynamic zone elasticity/rsi/stochastic has potential for shorttime frames.

    3 users thanked author for this post.
    #157384

    spoke too soon, got stopped again today, div by zero. so frustrating.

    I’ve read every thread on this subject and tried all the advice i could find. if anyone has any other bright suggestions I’d be most grateful.

    #157387

    Like Nicolas said, if x is the problem, maybe it could be a solution :

    But there could be some impacts on the p&l

    #157402

    thanks Roger, nice idea that could work for the div by zero, but unfortunately causes a 30% drop in performance. 🤔

    #157422

    I think it might be a issue with use of MTF. My ones that dont use mtf seems to run fine. The one I shared above uses some mtf and gets zero error.

    Maybe?

     

    #157426

    hard to see how that should result in this particular error though. I’ve been through the code countless times, line by line – nothing stands out that could repeatedly produce a division by zero. Doesn’t make sense. Shame because the backtest looks quite good.

    #157427

    Does it give the division by zero error regularly or randomly?

    Random meaning the Algo takes a few trades then threws up the error?

    #157448

    It’s random. Can be good for 2 or 3 days, take several trades, then gets the error.

    1 user thanked author for this post.
    #157531

    The IG / PRT error messages are not perfect (when the roulette wheel stops turning) and I can’t help thinking that maybe it is not a divide by zero error, but maybe just a zero error??

    What if a 1 min bar had zero typicalprice?

    Would be worth trying below (at Line 72) to see if makes any difference?

    OR GRAPH TypicalPrice = 0 (on 1 min TF)  and see if it ever is zero?

    Just a few thoughts.

     

    Or even GRAPH average[6,5](typicalprice) = 0.

    If 1 bar is zero on 1 min TF would the average of 6 bars = 0 or  would the average use the other 5 bars only with a value > 0

    More thoughts!? 🙂

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

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