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 on calling 'EventHandlerMarketData' method

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

    Error on calling 'EventHandlerMarketData' method

    I've built a Custom Indicator and it lists this error in the log tab after running for about an hour:
    Error on calling 'EventHandlerMarketData' method: Index was outside the bounds of the array.


    Interestingly, when I try to debug with VS, it will not throw any exceptions so that I can see where it is taking place. What is 'EventHandlerMarketData' and how can I debug it?

    #2
    Hello swcooke,

    This appears to be an error you have experienced before.
    I have a host/guest Indicator arrangement and I just cannot seem to escape the the Index Outside of the Bounds of the Array error. If I run the guest without the host, it is rock solid. However, when I run the host (which calls the guest) I get these errors: Indicator 'Guest': Error on calling 'EventHandlerMarketData' method:


    Please send an email to platormsupport [at] ninjatrader [dot] com, with a link to this forum post for further assistance.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Yes, it is. Can you give me some more info about EventHandlerMarketData so I can try to debug from my end?

      Comment


        #4
        Hello swcooke, thanks for your reply.

        EventHandlerMarketData is not documented, so I do not have any further information I can disclose about that method. We had a problem back in the beta that would cause this error, and this was fixed. I am assuming you are running the latest version of NinjaTrader.



        The beta problem was a race condition due to multi threading, any threading related code that might be in your script should be scrutinized.

        Since Visual Studio is not hitting the exception, you would need to add Print statements throughout the script to see where exactly that error is getting hit. Once you find that, I will need a test script if it is consistently reproducible that does not include DLL files.

        Best regards.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Thanks Chris,

          I seem to recall that you sent me a sample script back in April but I cannot locate it. Do you have any record of sending me a working version of something to my email that is associated with this forum account? If so, can you resend? Also, can you confirm if I create an indicator that exposes a Series, do I have to use Update() before my script returns the value of the Series or are Series Objects exempt from needing to do that?

          Comment


            #6
            swcooke, I found the ticket. The ticket number is 2488133, can you look this up in your email inbox to see the full thread? If you need me to upload the script I sent I can do that as well.
            Chris L.NinjaTrader Customer Service

            Comment


              #7
              Hi swcooke,

              There was a ticket opened with our QA team from that ticket you opened but was closed as we could not reproduce the problem. If you have a strategy that can consistently reproduce it I can take a look at this again.
              Attached Files
              Last edited by NinjaTrader_ChrisL; 09-03-2020, 03:19 PM.
              Chris L.NinjaTrader Customer Service

              Comment


                #8
                Hi Chris,

                I cannot find the email you sent to me and I think that would probably help the most. I want to see a working version just as you would do it (without my code at all). If you could please send that script to the email you sent it to last time that would be very helpful. Thanks,

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by DawnTreader, 05-08-2024, 05:58 PM
                20 responses
                78 views
                0 likes
                Last Post DawnTreader  
                Started by llanqui, Yesterday, 10:29 AM
                5 responses
                25 views
                0 likes
                Last Post llanqui
                by llanqui
                 
                Started by lorem, 04-25-2024, 09:18 AM
                14 responses
                59 views
                0 likes
                Last Post lorem
                by lorem
                 
                Started by TAJTrades, Today, 11:03 AM
                1 response
                8 views
                0 likes
                Last Post NinjaTrader_Clayton  
                Started by Dziu-Dziu, 02-04-2018, 07:46 AM
                26 responses
                1,771 views
                0 likes
                Last Post mochibocchi  
                Working...
                X