division by 0 error

Forums ProRealTime English forum ProOrder support division by 0 error

Viewing 6 posts - 1 through 6 (of 6 total)
  • #153213

    hi guys,

    I have read through the forums & found that this issue exists in several scenarios, i understand that the divisor cannot divide by 0 but neither of these should be throwing a 0.

    does anyone know what would cause this error with the code above, the code worked well without these lines but now that i have added them it stops the strategy from working.

    thanks in advance & apologies if this has been answered. the threads i read never actually had a fix just several ideas that seemed impractical.

    #153214

    i think i found the issue. its in the RateOfChangeB ROC[3](close[3]) i changed to RateOfChangeB ROC[3](close[2]). lets see if this throws the error

    #153215

    Why do you think that this is this code that is throwing this error please? Are you using a CALL to get the value of “change”?

    #153217

    Hi Nicolas, the strategy was working fine & running without the addition of the ROC function. This is what makes me think it’s this piece of code.

    I am still quite new to coding & strategy development so I am unsure exactly what a call is. I am assuming that a call is used when I want to use the parameter “change”.

    “Change” is used further in the code when sending buy or sell signal.

    apologies for code below doing this on mobile & having issues with editor.

    IF Change >= 9 THEN

    BUY X at market

    ENDIF

    #153218

    Side note changing the variable didn’t help

    #153221

    Try to replace your code with:

    It will ensure that the divisor is at least minimal size of a tick.

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

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