Strategy MAEX – experiment with MFE & MAE

Forums ProRealTime English forum ProOrder support Strategy MAEX – experiment with MFE & MAE

Tagged: ,

Viewing 15 posts - 46 through 60 (of 83 total)
  • #158345

    Anyone else get the dreaded div by zero for this? Apart from the indicators, the only lines I can see with division by anything are

    but n and nn have permanent values.

    🤔🤔🤔???

     

    #158368

    always that error!

    It’s either in that section or in the vectorial part.

    How about adding before

    maybe up to 8/9/10, to include vectorial. Not very nice but it makes sure when the calculation starts every bar has a range.

    Otherwise use min(x,x) for certain parts?

     

     

    #158370

    So, where would i add that line exactly? at the top of the //mfe & mae section?

    #158408

    Something like this,

    I thought I tried it in the past and in that situation it didn’t work, but I’ve got no other solution.

    vectorial seems ok and also Stochastic RSI

    ps you get check the time of the error and see if in the chart test=1

     

    #158448

    Hi guys!

     

    What is this error? I dn’t see it when I backtest! How does it affects the code?

    #158458

    it doesn’t show up in backtest, that is what’s so infuriating. Just when you think you’ve done the hard work and everything is sweet, you launch it but it wont run live because ‘division by zero’. They don’t tell you where the problem is and it’s almost never apparent in the code because the values are changing all the time. Try doing a search, there’s dozens of threads on the subject but I don’t think anyone’s found a cure.

    For me it is definitely worse in v11. Algos that ran fine in 10.3 are now getting stopped for this regularly.

    #158473

    Yeah, ive had a bunch of div 0 and similar errors recently. Very frustrating but a bit of hard work and help from the forum has solved them all.

    Fact is there will be something attempting to div/0 and a well placed MAX(<something above zero that doesn’t break your system>, <offending code>) will fix most of them.

    graph all your variables/returning values,  find the zero and it should be possible to fix.

    You can also try using If variable <> 0 then <do dodgy code>  Endifs also.

    its a pain but it is what it is.

    #158513

    I don’t think it’s the solution above/below works though in my post, because it only  solves to have a value before dividing it. And the error appears to be the other way around.

    Problem is a zero is never used as far I can tell.

    Anyway another way to have it programmed, instead testing and coding each bar individually, like this below. Should only take trades if the last xx bars have range and not have open=close=high=low.

     

    wild guess, but what if with live data feed i.e. there’s no tick/bar data is not the same as the backtest data?

    Something like backtestdata has open=low=high=close and running live the bar is simply skipped or the other way around.

    Maybe such bar is processed another way but not visible and maybe the error is broader then the error message itself gives indication.

     

     

    #158522

    Thanks Paul, I’ll try that and see if it runs 🤞

    #158536

    @nonetheless, can you please upload a .itf file? As I don’t see the error I’d like to see what’s the difference… thanks 😉

    #158539
    #158551

    Have you change something regarding the previous version? I don’t see any changes!

    #158553

    at the moment I have it in demo with Paul’s suggestion above but hasn’t taken a trade yet. When you say, ‘I don’t see the error’, do you mean you dont get division by zero rejection?

    #158558

    Yes exactly! Can you upload the version with the implementation of Paul’s suggestion?

    #158559

    it’s in my demo account that’s not open just now. but it’s exactly the same as v4.5 atr but add

    under the // mfe & mae section, with another endif at the bottom. There’s no other changes.

Viewing 15 posts - 46 through 60 (of 83 total)
Similar topics:

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