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.

    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.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        84 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        143 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        83 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        256 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        334 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X