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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        81 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        42 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        64 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        66 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        54 views
        0 likes
        Last Post CarlTrading  
        Working...
        X