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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        613 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        355 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        561 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        566 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X