Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error on indicator loading to renko bars

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Error on indicator loading to renko bars

    Hi,

    I developed an indicator that uses OnMarketData and has a lot of pretty complex calculations.

    The idea is to use it on Renko bars, more specifically I am trying to use it on the Unirenko bars created by Ninjatrader_ChelseaB.

    The indicator works perfectly on absolutely any other bar type ( range bar, time based, etc ). But I am struggling with the renko bars.
    Sometimes the indicator loads perfectly on the charts, but most of the time I get the error : Object reference not set to an instance of an object.

    I reviewed the code a thousand times, rewrote it step by step 2 times, with each step checking the loading on the chart, everything fine, but when i have the finished product, after one or two loads on renko, i always get the same error.
    I also noticed that it messes up with the database. I tried everything I could find on this forum, including repairing the database ( this helps temporarily ), clearing the cache, but my indicator only loads on renko charts when it wants to.
    Since I also use the indicator on range bars also and never ever encountered any issues, i suppose the problem might be with the formation of the renko bars.
    Is there something i am missing ? perhaps the renko bar type has issues? or would it be the formation of the renko bars ( based on the 1 min candles )?

    #2
    Hello gyilaoliver,

    The error you are getting means an object you tried to use was null. You would need to find which part of the code is having an error to point a direction. Do you know what specific line of code is having a problem?

    Comment


      #3
      Unfortunately i don't. The indicator has over 3000 lines, what i did was to rewrite everything line by line, compiled it and added it to the chart after almost every line of code. It all worked, even with the finished code. the problem is that, after 1 or 2 days of loading the indicator to the chart, it starts giving me this error. And the strange thing is that this error never appears on a range bar chart.
      Also, when the errors start to appear, the renko bar chart doesn't even load correctly anymore ( it has the last 10-20 bar displayed correctly, and historically there is huge spike of at least 1000 bars.
      Thinking maybe there would be a database issue?
      The range bar chart always loads correctly, that chart is never compromised

      Comment


        #4
        Hello gyilaoliver,

        In that case you also need to debug it. Rewriting it does no good unless you are checking each line as you write it that it works, that means testing the script each time you write one line of code or section of related code. You need to know which line is having a problem. You can use Print statements throughout your code to find where it stops working to get a better idea of the problem.

        Based on the details it sounds like a code problem and not a database issue. if other types work and just not renko that likely is due to the logic used in the script.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by abelsheila, 05-14-2025, 07:38 PM
        2 responses
        34 views
        0 likes
        Last Post hglover945  
        Started by nailz420, 05-14-2025, 09:14 AM
        1 response
        73 views
        0 likes
        Last Post NinjaTrader_ChristopherJ  
        Started by NinjaTrader_Brett, 05-12-2025, 03:19 PM
        0 responses
        353 views
        1 like
        Last Post NinjaTrader_Brett  
        Started by domjabs, 05-12-2025, 01:55 PM
        2 responses
        67 views
        0 likes
        Last Post domjabs
        by domjabs
         
        Started by Morning Cup Of Trades, 05-12-2025, 11:50 AM
        1 response
        87 views
        0 likes
        Last Post NinjaTrader_ChristopherJ  
        Working...
        X