• 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 akuntysh, Today, 02:43 AM
        0 responses
        4 views
        0 likes
        Last Post akuntysh  
        Started by thgamey, Today, 02:05 AM
        0 responses
        6 views
        0 likes
        Last Post thgamey
        by thgamey
         
        Started by tpdk2012, Today, 12:51 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_ChrisSch  
        Started by simonerg, Today, 12:13 AM
        0 responses
        7 views
        0 likes
        Last Post simonerg  
        Started by rickyblah12, 07-20-2019, 01:01 PM
        2 responses
        24 views
        0 likes
        Last Post NinjaTrader_ChrisSch  
        Working...
        X