Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Instrument.Expiry.Day incorrect

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

    Instrument.Expiry.Day incorrect

    I am trying to get the value for the last trading day of a contact with Instrument.Expiry.Day but it is incorrect, ie for the FGBL 09-2013 it is giving a value of 1 when the expiry was on the 5th? is there an other way to get the expiry day? The Month and Year values are correct.

    Could I use OnTermination() instead of running something on the last trading day if I want to print some values to output at the end of a contract, when does OnTermination get triggered?
    Last edited by GKonheiser; 09-25-2014, 06:20 AM.

    #2
    Hello,

    Thank you for the question.

    When you are trying to get the expiry it returns the correct month and year but as you have noticed you get a 1 for he day when using that statement.

    This is something where you would want to loop through the rollover collection to get the actual rollover day. There is not really any documentation on this as it is unsupported but this may help.

    There is a publicly available indicator that you can view the source of that shows how to do this. Here is a link: http://www.ninjatrader.com/support/f...d=4&linkid=558

    This essentially puts a rollover button in the chart but you could use the code it has in your own scripts if you wanted.

    The section you are looking at in the script is within the for statement looping through the rollover collection.

    Please let me know if I may be of additional assistance,

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    648 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    369 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    108 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    572 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    573 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X