Code fails to run – Insufficient Data!

Forums ProRealTime English forum ProOrder support Code fails to run – Insufficient Data!

Viewing 15 posts - 1 through 15 (of 19 total)
  • #177634
    smp

    Guys,

    In my code, I called up an indicator but every time it tries to run, it fails and gives the same error (Attached below).  I have DEFRAM Preloadbars set to 10000 as suggested in the error message; I also have loaded the code into a chart with units set to over 10000 units.  However, it will still not run

    It backtests no problem at all.

    Using Version 10.3

    Any ideas?

    #177644

    What is the max period used by any indicator of your system? Custom or default one?

    #177646
    smp

    I use the default 10000 units now.  When I first installed I used 200 units but changing from 200 to 10000 seems to have made no difference at all

    #177651

    Sorry but you did not answered the question. In your code, are you using indicators suchs as EMA, RSI, etc? If yes, what is the maximum period used in the code?

    #177652
    smp

    Sorry,

    I enclose the indicator called “KEY”

    Also, the code that calls it up

     

    Hope this helps

    #177660
    JS

    PreLoadBars

    The instruction “DefParam PreLoadBars” lets you configure the maximum amount of bars that are preloaded prior to the start of a trading system for the calculation of indicators used in the system prior to the system’s start (personal or predefined indicators). By default this parameter is equal to 1000. It cannot be less than 0 or higher than 5000. If you want to deactivate preloading data, set PreLoadBars = 0.

    The value selected is a maximum because the amount of bars that can be preloaded depends on the amount of data available for a given instrument and timeframe.

    If one of your indicators use more than 5000 bars then you get this error.

    2 users thanked author for this post.
    #177723

    Well, after inspection of the provided  codes, I do not see any special reason why you get this error message. You should send an error report through the assistance tool of the platform.

    1 user thanked author for this post.
    avatar smp
    #177731
    smp

    Thanks, reported issue to PRT

    #177752

    smpaxton  please let us know the PRT response.

    So often Reject error messages do not appear logical and it is so frustrating for us all getting rejected in Live and yet Backtest shows no problems.

    I would like to see PRT doing something toward aligning Live running and backtest re reject errors … even if it is only a series of hints / possible suggestions that gets flagged up after a backtest has run.  Not stop / reject the backtest as that would mean more load of PRT servers, just flag up possible reasons and possible solutions to code that may /  is likely to be rejected in Live.

    I can feel another Suggestion for Improvement to PRT coming on! 🙂

    #177760
    smp

    GraHal,

    Yes, no problem.  I do know the IG PRT team and spoke about the issue yesterday and they assure me they will be looking at it as a priority as it’s not the first time this has happened.  It’s one of the many reasons I will not use V11 of PRT yet as v11 has too many bugs that just are not been resolved!

    3 users thanked author for this post.
    #178247
    smp

    Guys,

    here is the final response from IG PRT, see blow.  It does not make sense!  Unless anyone can explain this!

     

    We’ve been guided by Eduard at PRT that your code issue has been resolved with the below feedback:

    His code is working on a 4 hours UT but not on 1hour UT.
    The error message is :
    “The trading system was stopped due to a division by zero in one of its sub-functions during the evaluation of the last candlestick.”

    After analyzing we saw that last candlestick has the same high and the same low as you can see below :
    20210917:170000,20210917:180000,4419.08,4419.08,4419.08,4419.08,3

    + in his code you can see this line:

    high= highest[period](high)
    llow = lowest[period](low)

    temp = 0.66 * ((mean – llow) / (hhigh – llow) – 0.5) + 0.67 * Ld36

    Therefore you have a division by 0 (because here low = high):
    high = low =>  (mean – llow) / (hhigh – llow)
    If the clients wants to trade on this UT he has to use a protection in case of high = low.

    Below you’ll find an example of protection:

    if hhigh-llow<> 0 then
    temp = 0.66 * ((mean – llow) / (hhigh – llow) – 0.5) + 0.67 * Ld36
    endif

    #178248

    JS

    preloadbars can be det over 5000? I have out it on 200000 on some of my robots?

    #178255

    It does not make sense!  Unless anyone can explain this!

    Looks to me that IG have got mixed up and sent you the solution to somebody else’s problem (divide by zero).

    1 user thanked author for this post.
    avatar smp
    #178256

    I have out it on 200000 on some of my robots?

    PreLoad bars cannot be more than 10,000 … no matter what we set it to.

    Default preload bars is 2000 and the max available is 10000.

    1 user thanked author for this post.
    avatar smp
    #178257

    If the result of high-low is zero, then the division is impossible.

    They suggested a solution.
    I think a better solution would be:

    1 user thanked author for this post.
    avatar smp
Viewing 15 posts - 1 through 15 (of 19 total)

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