arbitragelab.util.rollers

This module implements the (Crude Oil Future, NBP Future, RBOB Future, Grain Based Futures, Ethanol Future) Rollers.

Module Contents

Classes

CrudeOilFutureRoller

Rolls the contract data provided under the assumption

NBPFutureRoller

Rolls the contract data provided under the assumption that

RBFutureRoller

Rolls the contract data provided under the assumption that

GrainFutureRoller

Rolls the contract data provided under the assumption that

EthanolFutureRoller

Rolls the contract data provided under the assumption that

Functions

plot_historical_future_slope_state(...)

Plots a historical plot of the contango/backwardation states between two

class CrudeOilFutureRoller(open_col: str = 'PX_OPEN', close_col: str = 'PX_LAST')

Bases: arbitragelab.util.base_futures_roller.BaseFuturesRoller

Rolls the contract data provided under the assumption trading terminates 3 business day prior to the 25th calendar day of the month prior to the contract month. If the 25th calendar day is not a business day, trading terminates 4 business days prior to the 25th calendar day of the month prior to the contract month.

NOTE If you have reasons to believe that the termination dates / expiration method changed throughout the time series, direct your attention to:

https://www.cmegroup.com/tools-information/advisory-archive.html

fit(dataset: pandas.DataFrame)

Stores price data in the class object for later processing.

Parameters:

dataset – (pd.DataFrame) Future price data.

diagnostic_summary() pandas.DataFrame

After the dataset has been transformed, a dataframe with all the dates of each roll operation is stored in the class object. This will return that dataframe.

Returns:

(pd.DataFrame) Returns DataFrame with each roll and gap size.

transform(roll_forward: bool = True, handle_negative_roll: bool = False) pandas.Series

Processes the dataset provided with the set roll dates.

Parameters:
  • roll_forward – (bool) The direction which the gaps should sum to.

  • handle_negative_roll – (bool) Process to remove negative values from series.

Returns:

(pd.Series) Series of gaps or Preprocessed rolled series.

generate_diagnostic_frame(dataset: pandas.DataFrame, termination_date_indexes: numpy.array, following_dates: pandas.DatetimeIndex) pandas.DataFrame

Returns dataframe full of every roll operation and its gap size.

Parameters:
  • dataset – (pd.DataFrame) Price data.

  • termination_date_indexes – (np.array) Indexes of termination dates.

  • following_dates – (pd.DateTimeIndex) Dates following the termination dates.

Returns:

(pd.DataFrame) List of dates and their gap’s size.

static get_x_days_prior_available_target_date(n_days: int, dataset_datetime_index: pandas.DatetimeIndex, target_dates: pandas.DatetimeIndex) pandas.DataFrame

Gets x days prior to target date(that must be available in the dataset index).

Parameters:
  • n_days – (int) Number of days to be shifted by.

  • dataset_datetime_index – (pd.DateTimeIndex) All dates that occur in the dataset

  • target_dates – (pd.DateTimeIndex) Dates used as the start for the shift. Important(!) these dates need to exist in ‘dataset_datetime_index’.

Returns:

(pd.Series) Price series x days prior to target date.

static get_available_date_per_month_from(price_df: pandas.DataFrame) pandas.DataFrame

Gets first available day per month from the dataset.

Parameters:

price_df – (pd.DataFrame) Original prices dataframe.

Returns:

(pd.DataFrame) Frame with first available days per month.

static get_all_possible_static_dates_in(dataset_datetime_index: pandas.DatetimeIndex, day_of_month: int = 25) pandas.DataFrame

Gets a series of static dates that could happen in a specific time range, described by the input ‘dataset_datetime_index’. The dates returned from this method do not take into consideration the fact of if the specified date happened in the dataset or not.

Parameters:
  • dataset_datetime_index – (pd.DateTimeIndex) All dates that occur in the dataset.

  • day_of_month – (int) Day of month.

Returns:

(pd.DataFrame) Dates.

static get_x_days_prior_missing_target_date(dataset: pandas.DataFrame, working_month_delta: pandas.Period, days_prior: int = 3, target_day: int = 25)

This method will get x available day prior to a specific date, in the special case that that date doesn’t exist in the dataset.

Parameters:
  • dataset – (pd.DataFrame) Price data.

  • working_month_delta – (pd.Period) specific Year-Month delta, ex. 1995-12

  • days_prior – (int) Days prior the newly found target date.

  • target_day – (int) The target day to be used as a starting point.

Returns:

(np.array) Target Dates.

roll(dataset: pandas.DataFrame, roll_dates: pandas.Series, match_end: bool = True)

Deals with single futures contracts. Forms a series of cumulative roll gaps and returns a diagnostic dataframe with dates of rolls for further analysis.

Parameters:
  • dataset – (pd.DataFrame) Price data.

  • roll_dates – (pd.Series) Specific dates that the roll will initialized on.

  • match_end – (bool) Defines from where to match the gaps.

Returns:

(pd.Series) (pd.DataFrame) Returns gaps and diagnostic frame.

static non_negativeize(rolled_series: pandas.Series, raw_series: pandas.Series) pandas.Series

In general, non-negative series are preferred over negative series, which could easily occur, particularly if the contract sold off while in contango. The method employed here works as follows: the return as rolled price change is divided by the raw price and then a series is formed using those returns, ex (1+r).cumprod().

This method has been described originally in De Prado, M.L., 2018. “Advances in financial machine learning”. John Wiley & Sons.

Parameters:
  • rolled_series – (pd.Series) Rolled price change.

  • raw_series – (pd.Series) Raw price.

Returns:

(pd.Series) Resulting non-negative series.

class NBPFutureRoller(open_col: str = 'PX_OPEN', close_col: str = 'PX_LAST')

Bases: arbitragelab.util.base_futures_roller.BaseFuturesRoller

Rolls the contract data provided under the assumption that the termination date is the penultimate business day of the month.

fit(dataset: pandas.DataFrame)

Stores price data in the class object for later processing.

Parameters:

dataset – (pd.DataFrame) Future price data.

diagnostic_summary() pandas.DataFrame

After the dataset has been transformed, a dataframe with all the dates of each roll operation is stored in the class object. This will return that dataframe.

Returns:

(pd.DataFrame) Returns DataFrame with each roll and gap size.

transform(roll_forward: bool = True, handle_negative_roll: bool = False) pandas.Series

Processes the dataset provided with the set roll dates.

Parameters:
  • roll_forward – (bool) The direction which the gaps should sum to.

  • handle_negative_roll – (bool) Process to remove negative values from series.

Returns:

(pd.Series) Series of gaps or Preprocessed rolled series.

generate_diagnostic_frame(dataset: pandas.DataFrame, termination_date_indexes: numpy.array, following_dates: pandas.DatetimeIndex) pandas.DataFrame

Returns dataframe full of every roll operation and its gap size.

Parameters:
  • dataset – (pd.DataFrame) Price data.

  • termination_date_indexes – (np.array) Indexes of termination dates.

  • following_dates – (pd.DateTimeIndex) Dates following the termination dates.

Returns:

(pd.DataFrame) List of dates and their gap’s size.

static get_x_days_prior_available_target_date(n_days: int, dataset_datetime_index: pandas.DatetimeIndex, target_dates: pandas.DatetimeIndex) pandas.DataFrame

Gets x days prior to target date(that must be available in the dataset index).

Parameters:
  • n_days – (int) Number of days to be shifted by.

  • dataset_datetime_index – (pd.DateTimeIndex) All dates that occur in the dataset

  • target_dates – (pd.DateTimeIndex) Dates used as the start for the shift. Important(!) these dates need to exist in ‘dataset_datetime_index’.

Returns:

(pd.Series) Price series x days prior to target date.

static get_available_date_per_month_from(price_df: pandas.DataFrame) pandas.DataFrame

Gets first available day per month from the dataset.

Parameters:

price_df – (pd.DataFrame) Original prices dataframe.

Returns:

(pd.DataFrame) Frame with first available days per month.

static get_all_possible_static_dates_in(dataset_datetime_index: pandas.DatetimeIndex, day_of_month: int = 25) pandas.DataFrame

Gets a series of static dates that could happen in a specific time range, described by the input ‘dataset_datetime_index’. The dates returned from this method do not take into consideration the fact of if the specified date happened in the dataset or not.

Parameters:
  • dataset_datetime_index – (pd.DateTimeIndex) All dates that occur in the dataset.

  • day_of_month – (int) Day of month.

Returns:

(pd.DataFrame) Dates.

static get_x_days_prior_missing_target_date(dataset: pandas.DataFrame, working_month_delta: pandas.Period, days_prior: int = 3, target_day: int = 25)

This method will get x available day prior to a specific date, in the special case that that date doesn’t exist in the dataset.

Parameters:
  • dataset – (pd.DataFrame) Price data.

  • working_month_delta – (pd.Period) specific Year-Month delta, ex. 1995-12

  • days_prior – (int) Days prior the newly found target date.

  • target_day – (int) The target day to be used as a starting point.

Returns:

(np.array) Target Dates.

roll(dataset: pandas.DataFrame, roll_dates: pandas.Series, match_end: bool = True)

Deals with single futures contracts. Forms a series of cumulative roll gaps and returns a diagnostic dataframe with dates of rolls for further analysis.

Parameters:
  • dataset – (pd.DataFrame) Price data.

  • roll_dates – (pd.Series) Specific dates that the roll will initialized on.

  • match_end – (bool) Defines from where to match the gaps.

Returns:

(pd.Series) (pd.DataFrame) Returns gaps and diagnostic frame.

static non_negativeize(rolled_series: pandas.Series, raw_series: pandas.Series) pandas.Series

In general, non-negative series are preferred over negative series, which could easily occur, particularly if the contract sold off while in contango. The method employed here works as follows: the return as rolled price change is divided by the raw price and then a series is formed using those returns, ex (1+r).cumprod().

This method has been described originally in De Prado, M.L., 2018. “Advances in financial machine learning”. John Wiley & Sons.

Parameters:
  • rolled_series – (pd.Series) Rolled price change.

  • raw_series – (pd.Series) Raw price.

Returns:

(pd.Series) Resulting non-negative series.

class RBFutureRoller(open_col: str = 'PX_OPEN', close_col: str = 'PX_LAST')

Bases: arbitragelab.util.base_futures_roller.BaseFuturesRoller

Rolls the contract data provided under the assumption that the termination date is the last business day of the month.

The following contracts can be used under this class.

Refined Products - FO - Trading terminates on the last London business day of the contract month. - 7K - Trading terminates on the last business day of the contract month. - ME - Trading shall cease on the last business day of the contract month. - 1L - Trading terminates on the last business day of the contract month. - LT - Trading shall cease on the last business day of the contract month. - HO - Trading terminates on the last business day of the month prior to the contract month. - M1B - Trading terminates on the last business day of the contract month. - M35 - Trading terminates on the last business day of the contract month. - NYA - Trading terminates on the last business day of the contract month - NYR - Trading terminates on the last business day of the contract month - RBOB - Trading terminates on the last business day of the month prior to the contract month.

Crude Oil - LLB - Trading terminates on the last business day of the contract month. - LWB - Trading terminates on the last business day of the contract month. - WJ - Trading terminates on the last business day of the contract month. - CS - Trading shall cease on the last business day of the contract month. - BK - Trading shall cease on the last business day of the contract month.

BioFules - CU - Trading terminates on the last business day of the contract month.

fit(dataset: pandas.DataFrame)

Stores price data in the class object for later processing.

Parameters:

dataset – (pd.DataFrame) Future price data.

diagnostic_summary() pandas.DataFrame

After the dataset has been transformed, a dataframe with all the dates of each roll operation is stored in the class object. This will return that dataframe.

Returns:

(pd.DataFrame) Returns DataFrame with each roll and gap size.

transform(roll_forward: bool = True, handle_negative_roll: bool = False) pandas.Series

Processes the dataset provided with the set roll dates.

Parameters:
  • roll_forward – (bool) The direction which the gaps should sum to.

  • handle_negative_roll – (bool) Process to remove negative values from series.

Returns:

(pd.Series) Series of gaps or Preprocessed rolled series.

generate_diagnostic_frame(dataset: pandas.DataFrame, termination_date_indexes: numpy.array, following_dates: pandas.DatetimeIndex) pandas.DataFrame

Returns dataframe full of every roll operation and its gap size.

Parameters:
  • dataset – (pd.DataFrame) Price data.

  • termination_date_indexes – (np.array) Indexes of termination dates.

  • following_dates – (pd.DateTimeIndex) Dates following the termination dates.

Returns:

(pd.DataFrame) List of dates and their gap’s size.

static get_x_days_prior_available_target_date(n_days: int, dataset_datetime_index: pandas.DatetimeIndex, target_dates: pandas.DatetimeIndex) pandas.DataFrame

Gets x days prior to target date(that must be available in the dataset index).

Parameters:
  • n_days – (int) Number of days to be shifted by.

  • dataset_datetime_index – (pd.DateTimeIndex) All dates that occur in the dataset

  • target_dates – (pd.DateTimeIndex) Dates used as the start for the shift. Important(!) these dates need to exist in ‘dataset_datetime_index’.

Returns:

(pd.Series) Price series x days prior to target date.

static get_available_date_per_month_from(price_df: pandas.DataFrame) pandas.DataFrame

Gets first available day per month from the dataset.

Parameters:

price_df – (pd.DataFrame) Original prices dataframe.

Returns:

(pd.DataFrame) Frame with first available days per month.

static get_all_possible_static_dates_in(dataset_datetime_index: pandas.DatetimeIndex, day_of_month: int = 25) pandas.DataFrame

Gets a series of static dates that could happen in a specific time range, described by the input ‘dataset_datetime_index’. The dates returned from this method do not take into consideration the fact of if the specified date happened in the dataset or not.

Parameters:
  • dataset_datetime_index – (pd.DateTimeIndex) All dates that occur in the dataset.

  • day_of_month – (int) Day of month.

Returns:

(pd.DataFrame) Dates.

static get_x_days_prior_missing_target_date(dataset: pandas.DataFrame, working_month_delta: pandas.Period, days_prior: int = 3, target_day: int = 25)

This method will get x available day prior to a specific date, in the special case that that date doesn’t exist in the dataset.

Parameters:
  • dataset – (pd.DataFrame) Price data.

  • working_month_delta – (pd.Period) specific Year-Month delta, ex. 1995-12

  • days_prior – (int) Days prior the newly found target date.

  • target_day – (int) The target day to be used as a starting point.

Returns:

(np.array) Target Dates.

roll(dataset: pandas.DataFrame, roll_dates: pandas.Series, match_end: bool = True)

Deals with single futures contracts. Forms a series of cumulative roll gaps and returns a diagnostic dataframe with dates of rolls for further analysis.

Parameters:
  • dataset – (pd.DataFrame) Price data.

  • roll_dates – (pd.Series) Specific dates that the roll will initialized on.

  • match_end – (bool) Defines from where to match the gaps.

Returns:

(pd.Series) (pd.DataFrame) Returns gaps and diagnostic frame.

static non_negativeize(rolled_series: pandas.Series, raw_series: pandas.Series) pandas.Series

In general, non-negative series are preferred over negative series, which could easily occur, particularly if the contract sold off while in contango. The method employed here works as follows: the return as rolled price change is divided by the raw price and then a series is formed using those returns, ex (1+r).cumprod().

This method has been described originally in De Prado, M.L., 2018. “Advances in financial machine learning”. John Wiley & Sons.

Parameters:
  • rolled_series – (pd.Series) Rolled price change.

  • raw_series – (pd.Series) Raw price.

Returns:

(pd.Series) Resulting non-negative series.

class GrainFutureRoller(open_col: str = 'PX_OPEN', close_col: str = 'PX_LAST')

Bases: arbitragelab.util.base_futures_roller.BaseFuturesRoller

Rolls the contract data provided under the assumption that the termination date is the 15th of each month.

The following contracts can be used under this class.

  • S - Soybean

  • B0 - Soyoil

  • C - Corn

fit(dataset: pandas.DataFrame)

Stores price data in the class object for later processing.

Parameters:

dataset – (pd.DataFrame) Future price data.

diagnostic_summary() pandas.DataFrame

After the dataset has been transformed, a dataframe with all the dates of each roll operation is stored in the class object. This will return that dataframe.

Returns:

(pd.DataFrame) Returns DataFrame with each roll and gap size.

transform(roll_forward: bool = True, handle_negative_roll: bool = False) pandas.Series

Processes the dataset provided with the set roll dates.

Parameters:
  • roll_forward – (bool) The direction which the gaps should sum to.

  • handle_negative_roll – (bool) Process to remove negative values from series.

Returns:

(pd.Series) Series of gaps or Preprocessed rolled series.

generate_diagnostic_frame(dataset: pandas.DataFrame, termination_date_indexes: numpy.array, following_dates: pandas.DatetimeIndex) pandas.DataFrame

Returns dataframe full of every roll operation and its gap size.

Parameters:
  • dataset – (pd.DataFrame) Price data.

  • termination_date_indexes – (np.array) Indexes of termination dates.

  • following_dates – (pd.DateTimeIndex) Dates following the termination dates.

Returns:

(pd.DataFrame) List of dates and their gap’s size.

static get_x_days_prior_available_target_date(n_days: int, dataset_datetime_index: pandas.DatetimeIndex, target_dates: pandas.DatetimeIndex) pandas.DataFrame

Gets x days prior to target date(that must be available in the dataset index).

Parameters:
  • n_days – (int) Number of days to be shifted by.

  • dataset_datetime_index – (pd.DateTimeIndex) All dates that occur in the dataset

  • target_dates – (pd.DateTimeIndex) Dates used as the start for the shift. Important(!) these dates need to exist in ‘dataset_datetime_index’.

Returns:

(pd.Series) Price series x days prior to target date.

static get_available_date_per_month_from(price_df: pandas.DataFrame) pandas.DataFrame

Gets first available day per month from the dataset.

Parameters:

price_df – (pd.DataFrame) Original prices dataframe.

Returns:

(pd.DataFrame) Frame with first available days per month.

static get_all_possible_static_dates_in(dataset_datetime_index: pandas.DatetimeIndex, day_of_month: int = 25) pandas.DataFrame

Gets a series of static dates that could happen in a specific time range, described by the input ‘dataset_datetime_index’. The dates returned from this method do not take into consideration the fact of if the specified date happened in the dataset or not.

Parameters:
  • dataset_datetime_index – (pd.DateTimeIndex) All dates that occur in the dataset.

  • day_of_month – (int) Day of month.

Returns:

(pd.DataFrame) Dates.

static get_x_days_prior_missing_target_date(dataset: pandas.DataFrame, working_month_delta: pandas.Period, days_prior: int = 3, target_day: int = 25)

This method will get x available day prior to a specific date, in the special case that that date doesn’t exist in the dataset.

Parameters:
  • dataset – (pd.DataFrame) Price data.

  • working_month_delta – (pd.Period) specific Year-Month delta, ex. 1995-12

  • days_prior – (int) Days prior the newly found target date.

  • target_day – (int) The target day to be used as a starting point.

Returns:

(np.array) Target Dates.

roll(dataset: pandas.DataFrame, roll_dates: pandas.Series, match_end: bool = True)

Deals with single futures contracts. Forms a series of cumulative roll gaps and returns a diagnostic dataframe with dates of rolls for further analysis.

Parameters:
  • dataset – (pd.DataFrame) Price data.

  • roll_dates – (pd.Series) Specific dates that the roll will initialized on.

  • match_end – (bool) Defines from where to match the gaps.

Returns:

(pd.Series) (pd.DataFrame) Returns gaps and diagnostic frame.

static non_negativeize(rolled_series: pandas.Series, raw_series: pandas.Series) pandas.Series

In general, non-negative series are preferred over negative series, which could easily occur, particularly if the contract sold off while in contango. The method employed here works as follows: the return as rolled price change is divided by the raw price and then a series is formed using those returns, ex (1+r).cumprod().

This method has been described originally in De Prado, M.L., 2018. “Advances in financial machine learning”. John Wiley & Sons.

Parameters:
  • rolled_series – (pd.Series) Rolled price change.

  • raw_series – (pd.Series) Raw price.

Returns:

(pd.Series) Resulting non-negative series.

class EthanolFutureRoller(open_col: str = 'PX_OPEN', close_col: str = 'PX_LAST')

Bases: arbitragelab.util.base_futures_roller.BaseFuturesRoller

Rolls the contract data provided under the assumption that the termination date is the 3rd business day of each month.

fit(dataset: pandas.DataFrame)

Stores price data in the class object for later processing.

Parameters:

dataset – (pd.DataFrame) Future price data.

diagnostic_summary() pandas.DataFrame

After the dataset has been transformed, a dataframe with all the dates of each roll operation is stored in the class object. This will return that dataframe.

Returns:

(pd.DataFrame) Returns DataFrame with each roll and gap size.

transform(roll_forward: bool = True, handle_negative_roll: bool = False) pandas.Series

Processes the dataset provided with the set roll dates.

Parameters:
  • roll_forward – (bool) The direction which the gaps should sum to.

  • handle_negative_roll – (bool) Process to remove negative values from series.

Returns:

(pd.Series) Series of gaps or Preprocessed rolled series.

generate_diagnostic_frame(dataset: pandas.DataFrame, termination_date_indexes: numpy.array, following_dates: pandas.DatetimeIndex) pandas.DataFrame

Returns dataframe full of every roll operation and its gap size.

Parameters:
  • dataset – (pd.DataFrame) Price data.

  • termination_date_indexes – (np.array) Indexes of termination dates.

  • following_dates – (pd.DateTimeIndex) Dates following the termination dates.

Returns:

(pd.DataFrame) List of dates and their gap’s size.

static get_x_days_prior_available_target_date(n_days: int, dataset_datetime_index: pandas.DatetimeIndex, target_dates: pandas.DatetimeIndex) pandas.DataFrame

Gets x days prior to target date(that must be available in the dataset index).

Parameters:
  • n_days – (int) Number of days to be shifted by.

  • dataset_datetime_index – (pd.DateTimeIndex) All dates that occur in the dataset

  • target_dates – (pd.DateTimeIndex) Dates used as the start for the shift. Important(!) these dates need to exist in ‘dataset_datetime_index’.

Returns:

(pd.Series) Price series x days prior to target date.

static get_available_date_per_month_from(price_df: pandas.DataFrame) pandas.DataFrame

Gets first available day per month from the dataset.

Parameters:

price_df – (pd.DataFrame) Original prices dataframe.

Returns:

(pd.DataFrame) Frame with first available days per month.

static get_all_possible_static_dates_in(dataset_datetime_index: pandas.DatetimeIndex, day_of_month: int = 25) pandas.DataFrame

Gets a series of static dates that could happen in a specific time range, described by the input ‘dataset_datetime_index’. The dates returned from this method do not take into consideration the fact of if the specified date happened in the dataset or not.

Parameters:
  • dataset_datetime_index – (pd.DateTimeIndex) All dates that occur in the dataset.

  • day_of_month – (int) Day of month.

Returns:

(pd.DataFrame) Dates.

static get_x_days_prior_missing_target_date(dataset: pandas.DataFrame, working_month_delta: pandas.Period, days_prior: int = 3, target_day: int = 25)

This method will get x available day prior to a specific date, in the special case that that date doesn’t exist in the dataset.

Parameters:
  • dataset – (pd.DataFrame) Price data.

  • working_month_delta – (pd.Period) specific Year-Month delta, ex. 1995-12

  • days_prior – (int) Days prior the newly found target date.

  • target_day – (int) The target day to be used as a starting point.

Returns:

(np.array) Target Dates.

roll(dataset: pandas.DataFrame, roll_dates: pandas.Series, match_end: bool = True)

Deals with single futures contracts. Forms a series of cumulative roll gaps and returns a diagnostic dataframe with dates of rolls for further analysis.

Parameters:
  • dataset – (pd.DataFrame) Price data.

  • roll_dates – (pd.Series) Specific dates that the roll will initialized on.

  • match_end – (bool) Defines from where to match the gaps.

Returns:

(pd.Series) (pd.DataFrame) Returns gaps and diagnostic frame.

static non_negativeize(rolled_series: pandas.Series, raw_series: pandas.Series) pandas.Series

In general, non-negative series are preferred over negative series, which could easily occur, particularly if the contract sold off while in contango. The method employed here works as follows: the return as rolled price change is divided by the raw price and then a series is formed using those returns, ex (1+r).cumprod().

This method has been described originally in De Prado, M.L., 2018. “Advances in financial machine learning”. John Wiley & Sons.

Parameters:
  • rolled_series – (pd.Series) Rolled price change.

  • raw_series – (pd.Series) Raw price.

Returns:

(pd.Series) Resulting non-negative series.

plot_historical_future_slope_state(m1_last: pandas.Series, m2_open: pandas.Series) matplotlib.axes._axes.Axes

Plots a historical plot of the contango/backwardation states between two contracts.

Parameters:
  • m1_last – (pd.Series) The ‘close’ price vector for the month one contract.

  • m2_last – (pd.Series) The ‘open’ price vector for the month two contract.

Returns:

(Axes) Axes object.