Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Instrument FullName issue

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

    Instrument FullName issue

    Hi.

    I'd like to get the full name of a future instrument from its short name.
    For example, I'd like to get "MNQ 03-21" from just "MNQ".

    When I use this line of code :
    Print(Instrument.GetInstrument("MNQ").FullName);
    That just print "MNQ"

    How can I get the expiry date of an instrument contract ?

    Regards.

    #2
    And I would like to precise that I've tried the 'expiry' property :
    When I do :
    Print(Instrument.GetInstrument("MNQ").Expiry);
    I get : 01/12/2099 00:00:00

    And when I do :
    Print(Instrument.GetInstrument("MNQ 03-21").Expiry);
    I get : 01/03/2021 00:00:00

    How can I get 01/03/2021 00:00:00 with just "MNQ" as an entry ?

    Comment


      #3
      Hello thanajo,

      Thank you for the post.

      The Getinstrument method would need the full instrument name to locate it, that would include the contract. Generally for futures instruments and getting the name it would be the other way around, because your script is using a specific contract you would be able to get the MasterInstrument and its Name which would be just MNQ.

      The platform in general is not set up to use a futures instrument without a contract month specified. If the code you tried returned an instrument and did not have an error you may have a duplicate stock type instrument defined named MNQ, you would need to check the instrument manager to confirm that.


      I look forward to being of further assistance.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      602 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      347 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      559 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      558 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X