> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ninjatrader.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ninjatrader.com/_mcp/server.

# GetNextExpiry()

## 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

| Parameter     | Description                                      |
| ------------- | ------------------------------------------------ |
| **afterDate** | A **DateTime** value representing to be compared |

## Examples

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