Retrieve and Manage Expiry Dates with QM_ExpiryDate

The QM_ExpiryDate function allows you to fetch expiry dates (commonly associated with options or futures) for a given symbol directly in Excel. Whether you're monitoring numerous contracts or pinpointing specific expiry information, this function provides an efficient way to keep your trading data current—all within MarketXLS.

Why Use This Function?

  • Accurate Expiry Tracking: Eliminate manual tracking of expiry dates for options or futures symbols.
  • Time-Saving Data Retrieval: Automate data imports from your MarketXLS subscription without having to log in to multiple portals.
  • Streamlined Analysis: Use expiry date data to filter, sort, and perform additional Excel-based computations in your trading worksheets.
  • Real-World Applications: Perfect for traders managing multiple portfolios who need quick insights on upcoming contract expiries.

How to Use in Excel

Simply type the function as shown in your Excel worksheet cells:

=QM_ExpiryDate(symbol)

• Enter a valid symbol reference where “symbol” represents an option or futures ticker (some platforms use uniquely structured tickers).
• Press Enter to have MarketXLS pull the expiry date from QuoteMedia in the background.

Parameters Explained

Parameter Description Example Values Notes
symbol The ticker or identifier for the contract you want the expiry date of "AAPL230120C150", "TSLA230616P200", "ESU23" Be sure the symbol is properly formatted. If an invalid format is used or the symbol isn’t recognized, the function may return "NA".

• The function internally requests “expirydate” for the given symbol using MarketXLS’s data flow.
• If MarketXLS detects a missing symbol or invalid input, you may see “NA”.
• If data is refreshing from the data provider, you might see “Refreshing” displayed temporarily.

Example Usage

Basic Examples

  1. Single Symbol (Option Contract)

    • In cell A2, type the symbol: AAPL230120C150
    • In cell B2, enter the formula:
      =QM_ExpiryDate(A2)
    • The function will return the expiry date for the specified AAPL call option.
  2. Single Symbol (Futures Contract)

    • In cell A5, type the symbol: ESU23
    • In cell B5, enter the formula:
      =QM_ExpiryDate(A5)
    • You will see the expiry date for the E-mini S&P 500 September futures contract.

Advanced Scenarios

  1. Portfolio Sheet with Multiple Symbols
    Create a column listing multiple futures or option symbols (e.g., D2:D10). In the adjacent column (E2:E10), use the QM_ExpiryDate function to retrieve expiry dates for each symbol automatically. This setup allows quick comparison of expiry information side by side.

  2. Integrating with Other Excel Functions
    You can combine QM_ExpiryDate results with Excel’s conditional formatting. For instance, highlight contracts whose expiry date is less than 30 days away.
    Example formula in a conditional formatting rule might be:
    =($E2 - TODAY()) < 30

  3. Using Expiry Dates in a Trading Strategy

    • Filter out contracts that expire too soon or too far in the future before you run additional calculations.
    • Combine the results with volume or open interest metrics to narrow down ideal trading opportunities.

Common Questions and Troubleshooting

  1. “NA” Returned Even for a Valid Symbol

    • This can occur if the symbol’s data isn’t recognized or if the corresponding cache entries are missing. Double-check the symbol formatting.
    • MarketXLS might also respond with “NA” if it has a cached entry indicating no data exists for that particular “expirydate” field.
  2. “Refreshing” Message

    • When the MarketXLS service is in the process of retrieving new data, you may see “Refreshing.” Wait for the data to update and then recalculate or refresh.
  3. “Please Refresh” or Configuration Issues

    • If MarketXLS is not configured properly for QuoteMedia data or if your subscription lacks access, the function may request that you refresh your data or prompt you to configure settings.
    • Go to Settings/Help >> Settings >> Data Subscriptions and ensure your QuoteMedia subscription is active.
  4. License Validation Errors

    • If your MarketXLS license is invalid or expired, the function will not return valid data. Make sure your license is up to date.

With QM_ExpiryDate, you can seamlessly integrate expiry date data into your Excel workflow for better trading strategy and portfolio management. Whether you’re dealing with standard options on equities or large-scale futures contracts, MarketXLS helps you stay one step ahead with ease.

Get Access to 1 Billion Usable Market data points IN YOUR EXCEL SHEETS WITH EASY TO USE EXCEL FUNCTIONS

Get started today
MarketXLS Excel Add-in Tutorial - How to Use Expiry Date (On Demand) and Other Financial Formulas
How does MarketXLS work?