• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

... has called the Add() method with an invalid instrument...

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

    ... has called the Add() method with an invalid instrument...

    I want to catch the above message in my code, so my code can respond differently depending on whether it sees this message or not.

    There is no Exception being thrown that I can catch as far as I can see ...

    Any ideas how I might go about this?

    #2
    Hello AnotherTrader,

    Thank you for your post.

    You can loop through the Instruments collection, but may be unnecessary and use to many resources (memory for example).

    You could also loop through the Instrument List, but then the instrument would have to be in the that list or the error would occur again.

    However, catching the error itself would be easier. Although I do not know the means of doing so. I will look into this and follow up with you.
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      Thanks.

      Yes, please if you could learn what is required to catch the error and then post your findings, that would be great.

      Comment


        #4
        Hello AnotherTrader,

        Thank you for your patience.

        Unfortunately, I could not find any means to "catch" this message. You could create an instrument list to check against for the valid instrument, although if you are providing this to other users they would need that same instrument list.

        Please let me know if you have any questions.
        Patrick H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by RedDuke, Today, 01:59 PM
        0 responses
        10 views
        0 likes
        Last Post RedDuke
        by RedDuke
         
        Started by MarianApalaghiei, Today, 01:18 PM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by williamzz, Today, 01:00 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Jim  
        Started by edmata1109, Today, 12:40 PM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Kate  
        Started by ballboy11, Today, 11:57 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X