GetNextExpiry()

View as Markdown

Definition

Returns the current futures expiry compared to the time of the input value used for the method.

Method Return Value

A DateTime structure

Syntax

Bars.Instrument.MasterInstrument.GetNextExpiry(DateTime afterDate)

Parameters

ParameterDescription
afterDateA DateTime value representing to be compared

Examples

1// Indicates what the current expiry is in the bottom right of the chart
2Draw.TextFixed(this, "tag1", "The current expiry is " + Bars.Instrument.MasterInstrument.GetNextExpiry(DateTime.Now).ToString("MM-yy"), TextPosition.BottomRight);