• 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

Instrument.GetInstrument returns null

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

    Instrument.GetInstrument returns null

    I have added the instrument "OMXS30YM".


    Instrument instr = Cbi.Instrument.GetInstrument("OMXS30YM");
    retruns null

    Instrument instr = Cbi.Instrument.GetInstrument("AAPL");
    does not return null

    This code snippet finds the instrument:

    var instrList = (from instrument in Instrument.All where instrument.FullName == "OMXS30YM" select instrument).ToList();
    Instrument instr = instrList[0];


    Do you know why

    Cbi.Instrument.GetInstrument("OMXS30YM")

    return null when the instrument exists?


    #2
    Hello ellefk,

    Thank you for your patience.

    Can you attach a screenshot of the Tools > Instruments > OMXS30YM Instrument window so I may investigate this matter further?

    To send a screenshot with Windows 7 or newer I would recommend using Window's Snipping Tool.

    Click here for instructions: http://windows.microsoft.com/en-us/w...#1TC=windows-8

    Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.

    Click here for detailed instruction: http://take-a-screenshot.org/

    I look forward to your response.
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      See attached file

      See attached file of screenshot
      Attached Files

      Comment


        #4
        Hello ellefk,

        Thank you for your response.

        The Instrument needs to be set up as an Index rather than a Stock and then when you call it in the string please use the following:
        Code:
        Instrument instr = Cbi.Instrument.GetInstrument("^OMXS30YM");
        All indices require the "^" at the beginning of the name.

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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Vincere, Today, 04:38 AM
        0 responses
        2 views
        0 likes
        Last Post Vincere
        by Vincere
         
        Started by trader_rick, Today, 04:02 AM
        1 response
        3 views
        0 likes
        Last Post NinjaTrader_ChrisSch  
        Started by percma, Today, 02:51 AM
        0 responses
        5 views
        0 likes
        Last Post percma
        by percma
         
        Started by Abilene, Today, 01:27 AM
        0 responses
        15 views
        0 likes
        Last Post Abilene
        by Abilene
         
        Started by simjs, Yesterday, 08:11 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_ChrisSch  
        Working...
        X