Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

error calling one indicator result to another

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

    error calling one indicator result to another

    I made an indicator that's calling results from other indicators. One works, the other gives me this:

    "Error on calling 'OnBarUpdate' method for indicator 'itf' on bar 35102: Object reference not set to an instance of an object."

    The indicators I'm calling are similar, so this has to be a very small error on my part. I've been trying to see the error but with no luck. Could you please tell me where to focus my attn? What is typically the problem in cases like this?

    Thank you.

    (I'm unable to send you my indicators.)

    #2
    Originally posted by imalil View Post
    I made an indicator that's calling results from other indicators. One works, the other gives me this:

    "Error on calling 'OnBarUpdate' method for indicator 'itf' on bar 35102: Object reference not set to an instance of an object."

    The indicators I'm calling are similar, so this has to be a very small error on my part. I've been trying to see the error but with no luck. Could you please tell me where to focus my attn? What is typically the problem in cases like this?

    Thank you.

    (I'm unable to send you my indicators.)
    Just to confirm - is this NT7 or NT8?

    I only have interest since in NT8 - my strategies which use an indicator disable on contract switchover on first day - only if I have historical data loaded on that machine - it's also random.sometimes it does, other times not. Then it's on different contracts in playback-market replay.


    Comment


      #3
      NT7. It uses level 2 non-historical data.

      Comment


        #4
        Hello imali, and thank you for your question.

        The place to start looking for more detailed information is generally your log and trace files. These files typically have a full stack trace, rather than the single line of output that showed up for you.

        You will find the log file on your PC in the (My) Documents > NinjaTrader 7 > Log folder.
        • The log file will be named "log.YYYYMMDD.txt"

        You will find the trace file on your PC in the (My) Documents > NinjaTrader 7 > Trace folder.
        • The trace file will be named "trace.YYYYMMDD.txt"

        If you would like, you can e-mail these files to platformsupport[at]ninjatrader[dot]com, referencing this unique ticket ID :

        1493308

        We will then be happy to review these files and give you a more detailed answer.
        Jessica P.NinjaTrader Customer Service

        Comment


          #5
          One more thing before I send anything along. Every now and then the indicator gives me the right number. It's rare but it works sometimes. Most of the time I get the error message. So I know I'm relatively close to what I want.

          Please finish this sentence: "There are many things it could be, but often times when this error occurs when calling level 2 data from another indicator it means.....?????"

          Just give me an idea of where to look.
          Thank you.

          Comment


            #6
            Unset object references mean that a variable was not set to a default value, for instance in Initialize(). The fact that you are calling this from another indicator makes this even more likely.

            The output you have already received tells us that the unset variable lives in OnBarUpdate(). The most common methods that return nulls that are called from OnBarUpdate, are order entry methods. So I would start investigating there.
            Jessica P.NinjaTrader Customer Service

            Comment


              #7
              Thank you. If I strike-out I'll let you know.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Max238, Today, 01:28 AM
              2 responses
              26 views
              0 likes
              Last Post NinjaTrader_ChristopherJ  
              Started by Shansen, 08-30-2019, 10:18 PM
              25 responses
              949 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by JonesJoker, 04-22-2024, 12:23 PM
              8 responses
              41 views
              0 likes
              Last Post JonesJoker  
              Started by timko, Today, 06:45 AM
              0 responses
              4 views
              0 likes
              Last Post timko
              by timko
               
              Started by Waxavi, 04-19-2024, 02:10 AM
              2 responses
              39 views
              0 likes
              Last Post poeds
              by poeds
               
              Working...
              X