ProOrder Exception Line Number

Forums ProRealTime English forum ProOrder support ProOrder Exception Line Number

  • This topic has 7 replies, 4 voices, and was last updated 3 years ago by avatarΞ3.
Viewing 8 posts - 1 through 8 (of 8 total)
  • #140221
    Ξ3

    Hi All,

    I have a fairly complex piece of automated code running on IG ProRealTime 10.3 that on the odd occasion comes up with a divide by zero error when using multi-timeframe… I suspect it might be due to a “phantom” bar but have gone through my code in detail yet I am unable to identify where the problem is sneaking in.

    Is there any way to get a rough idea of which line in the code causes this exception (or at least somehow narrow it down a bit)? I can’t seem to find any indication on any error message? Of course it works perfectly during back-testing 😉

    Any help or ideas would be greatly appreciated.

    #140225

    Check all divisions in your code, is there any possibility that the divisor can be equal to 0? If yes, you have your answer! 😉

    #140228
    Ξ3

    Good advice Nicholas but I have gone through my code and put IF statements around all divisors to protect against zero (or at least that’s what I thought). I guess the answer is that there is no place find the actual offending code or line number in any error message? 🙁

     

    #140251

    I do not know any other “exception” way to debug this issue. PRT is more like a simple scripting language thus it doesn’t offer many features from the common programming language (e.g. exception, function block, etc…) although it keeps improving.

    From  my experience on one occurrence for division zero issue (which for some reasons back test doesn’t catch it), you can pay attention to the timing when the zero division error message happened (PRT should send you a notification when it happen) and from there, you can observe from chart what information has gone wrong.

    Like below, I have to add condition “IF bolltrendUP = bolltrendDOWN THEN”, otherwise, they can end up with same value and when going to (bolltrendUP – bolltrendDOWN), it is zero. I only find it by focusing on the timing when the error happens and I put up the indicator and see for myself.

    It happened on MTF as well for me, the bolltrendperiod and strend were rather small thus resulted such issue occasionally.

     

    #140253

    Out of curiosity, I tested with this simple code, the back test doesn’t give me any error. When 4 / 0 happens, C2 just equal to 0 and test continue to next trade.

    So back test cannot catch division zero…maybe can be an improvement to send to PRT

     

    1 user thanked author for this post.
    avatar Ξ3
    #140256
    Ξ3

    Dow Jones,

    Your idea of comparing the failure time with the various MTF chart timeframes used may just do the trick for me.

    Many thanks for the detailed response!

    #140295

    Have also had my fair share of this problem. Something I have picked up is that if division happens with a variable that is perhaps undefined at any particular stage you will also get that error.

    Can be mitigated by using prober initiation parameters i.e. once

    2 users thanked author for this post.
    #140296
    Ξ3

    Worth looking into… Thanks JuanJ

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

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