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

... 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.

    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.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by judysamnt7, 03-13-2023, 09:11 AM
        4 responses
        55 views
        0 likes
        Last Post DynamicTest  
        Started by ScottWalsh, Today, 06:52 PM
        4 responses
        35 views
        0 likes
        Last Post ScottWalsh  
        Started by olisav57, Today, 07:39 PM
        0 responses
        7 views
        0 likes
        Last Post olisav57  
        Started by trilliantrader, Today, 03:01 PM
        2 responses
        19 views
        0 likes
        Last Post helpwanted  
        Started by cre8able, Today, 07:24 PM
        0 responses
        7 views
        0 likes
        Last Post cre8able  
        Working...
        X