M-X Outliers

Just a small notebook to find the biggest trades that were taken on M-X for the day. This notebook follows a big trader rolling puts on HMMJ.

In [1]:
import pandas as pd
import csv

import numpy as np

import matplotlib.pyplot as plt
import matplotlib.dates as dates

!pip install mibian
import mibian as mb
Collecting mibian
  Downloading https://files.pythonhosted.org/packages/e5/74/25719d1f66b84561f209692947980660268cf601dc92766547b626eb03d5/mibian-0.1.3.tar.gz
Building wheels for collected packages: mibian
  Building wheel for mibian (setup.py) ... done
  Created wheel for mibian: filename=mibian-0.1.3-cp36-none-any.whl size=4041 sha256=747bfc21549c33fa6953c150ff6ca92b2c000609e5e79fc3e9e218b1d244d67d
  Stored in directory: /root/.cache/pip/wheels/34/c7/51/22486b811445a01dab50193c9748e94242e55a4ce686a24240
Successfully built mibian
Installing collected packages: mibian
Successfully installed mibian-0.1.3

End of Day Data can be fetched from the following URL

https://www.m-x.ca/nego_fin_jour_en.php

In [2]:
from google.colab import drive
drive.mount('/content/drive')
Go to this URL in a browser: https://accounts.google.com/o/oauth2/auth?client_id=947318989803-6bn6qk8qdgf4n4g3pfee6491hc0brc4i.apps.googleusercontent.com&redirect_uri=urn%3aietf%3awg%3aoauth%3a2.0%3aoob&response_type=code&scope=email%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdocs.test%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdrive%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdrive.photos.readonly%20https%3a%2f%2fwww.googleapis.com%2fauth%2fpeopleapi.readonly

Enter your authorization code:
··········
Mounted at /content/drive
In [10]:
symbol = 'HMMJ'



datapath = 'https://www.m-x.ca/nego_fin_jour_en.php?symbol='+symbol+'&from=2019-05-01&to=2019-10-01&dnld=1'
#datapath = '/content/drive/My Drive/MX Option Data/quote_'+symbol+'_20190412_20191010.csv'



full_data_set = pd.read_csv(datapath)

options = full_data_set.loc[full_data_set['Symbol'] != symbol]
options = options.loc[options['Symbol'] != symbol+'.A']

shares = full_data_set.loc[full_data_set['Symbol'] == symbol]

print(options.columns)


options['Date'] = pd.to_datetime(options['Date'])
options['Expiry Date'] = pd.to_datetime(options['Expiry Date'])

shares['Date'] = pd.to_datetime(shares['Date'])
Index(['Date', 'Symbol', 'Class Symbol', 'Root Symbol', 'Underlying Symbol',
       'Strike Price', 'Expiry Date', 'Call/Put', 'Ins. Type', 'Bid Price',
       'Ask Price', 'Bid Size', 'Ask Size', 'Last Price', 'Volume',
       'Last Close Price', 'Net Change', 'Open Price', 'High Price',
       'Low Price', 'Total Value', 'Nb. Trades', 'Settlement Price',
       'Open Interest', 'Implied Volatility'],
      dtype='object')
/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py:23: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy

Data has been parsed and separated into big fish day trades.

Let's instead diverge from identfying big fish, and start to evaluate the chain as a whole.

We must begin by tracking the greeks of each trade. From there, was can create the overall equity's gamma exposrue throughn options.

With this data, predictions could be made for the closign price of the underlying asset on expiration dates. Allowing fro weekly movement predictions.

It could be possible to use ML techniques to make said predictions.

A simple regressive decision tree may be able to make those predictions using an array of trade data.

In [11]:
print(shares.head(5))
print(options.head(5))

# I like to see the data before I work with it. Not preprocessing, just making sure the computer and I are trying to talk about the same thing.
          Date Symbol  ... Open Interest Implied Volatility
0   2019-05-01   HMMJ  ...             0                0.0
191 2019-05-02   HMMJ  ...             0                0.0
382 2019-05-03   HMMJ  ...             0                0.0
575 2019-05-06   HMMJ  ...             0                0.0
742 2019-05-07   HMMJ  ...             0                0.0

[5 rows x 25 columns]
        Date              Symbol  ... Open Interest Implied Volatility
1 2019-05-01  HMMJ  190503C18.00  ...             0            116.456
2 2019-05-01  HMMJ  190503C18.50  ...             0            100.072
3 2019-05-01  HMMJ  190503C19.00  ...             0             83.813
4 2019-05-01  HMMJ  190503C19.50  ...             0             67.569
5 2019-05-01  HMMJ  190503C20.00  ...             0             63.283

[5 rows x 25 columns]
In [12]:
volumes = options['Volume']

volume_std = np.std(volumes) #Basic Volume Standard Deviation for all strikes/expiries on a daily basis.
big_fish_limit = 7.0 #How big of a fish do we want to catch? Based on STDs, 7 represents the biggest of volume.

print(volume_std)

options['Capital'] = options['Last Price'] * options['Volume'] * 100 #Assume that all volume was executed at the EoD "Last" Price. This is a major flaw imho, but we are limited by m-x EoD data.

#"Big Fish" are our unusual activity. We want to know a few things; 
# They're moving volume way bigger than the daily expected volume (volume_std)
# Their trade volume is larger than existing open interest. This sugggests they are opening a position.
# Finally, we want to be sure they're moving an egregious amount of capital for the Canadian Equity Derivatives market.
big_fish = options.loc[(options['Volume'] > (big_fish_limit * volume_std)) & (options['Volume'] > options['Open Interest']) & (options['Capital'] > 1000)] 

print(big_fish['Capital'])

#Reducing our data down to the columns we actually
parsed_fish = big_fish[['Date', 'Symbol', 'Strike Price', 'Expiry Date', 'Last Price', 'Volume', 'Open Interest', 'Capital']]

print(parsed_fish[['Date', 'Symbol', 'Capital', 'Volume', 'Open Interest']])
153.99267490114335
6837     150150.0
6838     230000.0
10889    281050.0
10890    462530.0
13334    195000.0
14393    320400.0
16914     75000.0
16990    282000.0
16993    625000.0
18608    175000.0
18807    841380.0
Name: Capital, dtype: float64
            Date              Symbol   Capital  Volume  Open Interest
6837  2019-06-24  HMMJ  190816P17.00  150150.0    2002             16
6838  2019-06-24  HMMJ  190816P18.00  230000.0    2000             14
10889 2019-07-29  HMMJ  190920P15.00  281050.0    4015             31
10890 2019-07-29  HMMJ  190920P16.00  462530.0    4022            127
13334 2019-08-19  HMMJ  191018P14.00  195000.0    3000             10
14393 2019-08-27  HMMJ  191018P13.00  320400.0    4005              1
16914 2019-09-17  HMMJ  191115C18.00   75000.0    5000             67
16990 2019-09-17  HMMJ  191115P12.00  282000.0    7050              0
16993 2019-09-17  HMMJ  191115P14.50  625000.0    5000              0
18608 2019-09-30  HMMJ  191220P10.00  175000.0    3500              0
18807 2019-10-01  HMMJ  191220P10.00  841380.0   14023           3500
In [13]:
#@title Default title text
#options.reset_index(drop=True)
#big_fish.reset_index(drop=True)

signal_trades = options.loc[options['Symbol'].isin(big_fish['Symbol'])] #Pull out the contract history for any contract that was moved by a big fish.

expiries = signal_trades.loc[signal_trades['Date'] == signal_trades['Expiry Date']] #What did those contracts look like at expiry?

highest = signal_trades.loc[signal_trades.groupby('Symbol')['Last Price'].idxmax(), :] #At what price did they trade the highest, and when?

#Maybe our big fish closed? Let's give a "rough chop" at potentially identifying these exits. 
# We want to be sure there's a ton of Open Interest already. 
# We also want to know that it's still big volume trading. Capital is less important now.
possible_exits = options.loc[(options['Volume'] > (0.3 * options['Open Interest'])) & (options['Open Interest'] > (7 * volume_std))] 


#Let's see what we got for this equity :
print(parsed_fish[['Date', 'Symbol', 'Last Price', 'Volume', 'Open Interest']])
print(expiries[['Date', 'Symbol', 'Last Price', 'Volume', 'Open Interest']])
print(highest[['Date', 'Symbol', 'Last Price', 'Volume', 'Open Interest']])
print(possible_exits[['Date', 'Symbol', 'Last Price', 'Volume', 'Open Interest']])
            Date              Symbol  Last Price  Volume  Open Interest
6837  2019-06-24  HMMJ  190816P17.00        0.75    2002             16
6838  2019-06-24  HMMJ  190816P18.00        1.15    2000             14
10889 2019-07-29  HMMJ  190920P15.00        0.70    4015             31
10890 2019-07-29  HMMJ  190920P16.00        1.15    4022            127
13334 2019-08-19  HMMJ  191018P14.00        0.65    3000             10
14393 2019-08-27  HMMJ  191018P13.00        0.80    4005              1
16914 2019-09-17  HMMJ  191115C18.00        0.15    5000             67
16990 2019-09-17  HMMJ  191115P12.00        0.40    7050              0
16993 2019-09-17  HMMJ  191115P14.50        1.25    5000              0
18608 2019-09-30  HMMJ  191220P10.00        0.50    3500              0
18807 2019-10-01  HMMJ  191220P10.00        0.60   14023           3500
            Date              Symbol  Last Price  Volume  Open Interest
13148 2019-08-16  HMMJ  190816P17.00        1.65      10            150
13149 2019-08-16  HMMJ  190816P18.00        2.65      10             63
17502 2019-09-20  HMMJ  190920P15.00        1.30      37            147
17503 2019-09-20  HMMJ  190920P16.00        2.30      24            351
            Date              Symbol  Last Price  Volume  Open Interest
12964 2019-08-15  HMMJ  190816P17.00        1.90      35            163
12965 2019-08-15  HMMJ  190816P18.00        2.85       6             63
14383 2019-08-27  HMMJ  190920P15.00        1.45      10           4037
14384 2019-08-27  HMMJ  190920P16.00        2.35    4005           4006
18782 2019-10-01  HMMJ  191018P13.00        1.70    4000           4033
18783 2019-10-01  HMMJ  191018P14.00        2.60    3000           3005
6267  2019-06-19  HMMJ  191115C18.00        2.15       0              0
18794 2019-10-01  HMMJ  191115P12.00        1.25      22           7042
18797 2019-10-01  HMMJ  191115P14.50        3.25       0           5010
18807 2019-10-01  HMMJ  191220P10.00        0.60   14023           3500
            Date              Symbol  Last Price  Volume  Open Interest
6830  2019-06-24  HMMJ  190719P21.00        3.10    2000           2021
10878 2019-07-29  HMMJ  190816P17.00        1.35    2000           2050
10879 2019-07-29  HMMJ  190816P18.00        2.20    2000           2015
14384 2019-08-27  HMMJ  190920P16.00        2.35    4005           4006
16969 2019-09-17  HMMJ  190920P15.00        0.80    4007           4057
18782 2019-10-01  HMMJ  191018P13.00        1.70    4000           4033
18783 2019-10-01  HMMJ  191018P14.00        2.60    3000           3005
18807 2019-10-01  HMMJ  191220P10.00        0.60   14023           3500

Who's taking the biggest risks with the most capital? I want to follow those with the most risk and risk-off when those other fish risk off aswell.

Do these fish make money?

In [14]:
total_profit = np.empty(big_fish['Symbol'].shape)
total_percent_profit = np.empty(big_fish['Symbol'].shape)

#This "Backtest" is pretty useless. It's certainly not a robust test.
#We're just checking to see if the big fish were given better prices, and if they made money. 
def backtest(contract, index) :
  
  total_contract_history = options.loc[options['Symbol'] == contract['Symbol']]
  trimmed_contract_history = total_contract_history.loc[total_contract_history['Date'] >= contract['Date']]
  
  #print(trimmed_contract_history[['Date', 'Symbol', 'Last Price', 'Open Interest']])
  
  max_realized = trimmed_contract_history.loc[trimmed_contract_history['Last Price'].idxmax()]
  
  #print(max_realized['Last Price'].dtypes)
  
  total_profit[index] = max_realized['Last Price'] - contract['Last Price']
  
  total_percent_profit[index] = (max_realized['Last Price'] - contract['Last Price']) / contract['Last Price'] * 100
  
  
  if max_realized['Last Price'] - contract['Last Price'] == 0 :
    total_profit[index] = -contract['Last Price']
    total_percent_profit[index] = -100
    max_realized['Last Price'] = 0
    
    
    
    
    
  #if max_realized
  
  print(total_profit[index])
  print(total_percent_profit[index])

  print(f"Contract opened for: {contract['Last Price']}")
  print(f"Contract closed for: {max_realized['Last Price']}")



big_fish = big_fish.reset_index(drop = True)

print(big_fish)

for index, contract in big_fish.iterrows():
  backtest(contract, index)
  
  

print(total_percent_profit)
plt.figure(1)
plt.plot(np.cumsum(total_percent_profit))
  
  
  
         Date              Symbol  ... Implied Volatility   Capital
0  2019-06-24  HMMJ  190816P17.00  ...             45.142  150150.0
1  2019-06-24  HMMJ  190816P18.00  ...             45.757  230000.0
2  2019-07-29  HMMJ  190920P15.00  ...             45.732  281050.0
3  2019-07-29  HMMJ  190920P16.00  ...             45.236  462530.0
4  2019-08-19  HMMJ  191018P14.00  ...             50.152  195000.0
5  2019-08-27  HMMJ  191018P13.00  ...             55.823  320400.0
6  2019-09-17  HMMJ  191115C18.00  ...             44.016   75000.0
7  2019-09-17  HMMJ  191115P12.00  ...             54.596  282000.0
8  2019-09-17  HMMJ  191115P14.50  ...              0.000  625000.0
9  2019-09-30  HMMJ  191220P10.00  ...             54.235  175000.0
10 2019-10-01  HMMJ  191220P10.00  ...             55.090  841380.0

[11 rows x 26 columns]
1.15
153.33333333333331
Contract opened for: 0.75
Contract closed for: 1.9
1.7000000000000002
147.82608695652178
Contract opened for: 1.15
Contract closed for: 2.85
0.75
107.14285714285714
Contract opened for: 0.7
Contract closed for: 1.45
1.2000000000000002
104.34782608695654
Contract opened for: 1.15
Contract closed for: 2.35
1.9500000000000002
300.0
Contract opened for: 0.65
Contract closed for: 2.6
0.8999999999999999
112.49999999999997
Contract opened for: 0.8
Contract closed for: 1.7
-0.15
-100.0
Contract opened for: 0.15
Contract closed for: 0
0.85
212.5
Contract opened for: 0.4
Contract closed for: 1.25
2.0
160.0
Contract opened for: 1.25
Contract closed for: 3.25
0.09999999999999998
19.999999999999996
Contract opened for: 0.5
Contract closed for: 0.6
-0.6
-100.0
Contract opened for: 0.6
Contract closed for: 0
[ 153.33333333  147.82608696  107.14285714  104.34782609  300.
  112.5        -100.          212.5         160.           20.
 -100.        ]
/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py:25: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
Out[14]:
[<matplotlib.lines.Line2D at 0x7f6ee322f438>]

Time for some fun charts!

In [15]:
!pip install backtesting
from backtesting import Backtest
from backtesting.lib import SignalStrategy, TrailingStrategy
Requirement already satisfied: backtesting in /usr/local/lib/python3.6/dist-packages (0.1.7)
Requirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (from backtesting) (1.18.4)
Requirement already satisfied: pandas!=0.25.0,>=0.25.0 in /usr/local/lib/python3.6/dist-packages (from backtesting) (1.0.3)
Requirement already satisfied: bokeh>=1.4.0 in /usr/local/lib/python3.6/dist-packages (from backtesting) (1.4.0)
Requirement already satisfied: python-dateutil>=2.6.1 in /usr/local/lib/python3.6/dist-packages (from pandas!=0.25.0,>=0.25.0->backtesting) (2.8.1)
Requirement already satisfied: pytz>=2017.2 in /usr/local/lib/python3.6/dist-packages (from pandas!=0.25.0,>=0.25.0->backtesting) (2018.9)
Requirement already satisfied: six>=1.5.2 in /usr/local/lib/python3.6/dist-packages (from bokeh>=1.4.0->backtesting) (1.12.0)
Requirement already satisfied: PyYAML>=3.10 in /usr/local/lib/python3.6/dist-packages (from bokeh>=1.4.0->backtesting) (3.13)
Requirement already satisfied: tornado>=4.3 in /usr/local/lib/python3.6/dist-packages (from bokeh>=1.4.0->backtesting) (4.5.3)
Requirement already satisfied: packaging>=16.8 in /usr/local/lib/python3.6/dist-packages (from bokeh>=1.4.0->backtesting) (20.4)
Requirement already satisfied: pillow>=4.0 in /usr/local/lib/python3.6/dist-packages (from bokeh>=1.4.0->backtesting) (7.0.0)
Requirement already satisfied: Jinja2>=2.7 in /usr/local/lib/python3.6/dist-packages (from bokeh>=1.4.0->backtesting) (2.11.2)
Requirement already satisfied: pyparsing>=2.0.2 in /usr/local/lib/python3.6/dist-packages (from packaging>=16.8->bokeh>=1.4.0->backtesting) (2.4.7)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.6/dist-packages (from Jinja2>=2.7->bokeh>=1.4.0->backtesting) (1.1.1)
In [16]:
print(shares.columns)


historical_SPX_closes = shares[['Date','Open Price','High Price','Low Price','Last Close Price']]

column_names = ['Date','Open','High','Low','Close']

backtest_data = pd.DataFrame(historical_SPX_closes, columns = column_names)
backtest_data.Open = historical_SPX_closes['Open Price']
backtest_data.High = historical_SPX_closes['High Price']
backtest_data.Low = historical_SPX_closes['Low Price']
backtest_data.Close = historical_SPX_closes['Last Close Price']

backtest_data.fillna(1)



backtest_dates = shares['Date']




print(backtest_dates.head(5))

k_signal = []
for date in backtest_dates :
  for entry in big_fish.Date :
    if date == entry :
      trade = big_fish.loc[big_fish['Date'] == entry]
      
      if trade['Call/Put'].any() :
        k_signal.append(-1)
      else: 
        print(trade['Call/Put'])
        k_signal.append(1)
      break;
        
  k_signal.append(0)

print(k_signal)

class kCluster(SignalStrategy, TrailingStrategy):
    def init(self):
      super().init()
      print(self.data.index)
      self.set_signal(k_signal)
      self.set_atr_periods(10)
      self.set_trailing_sl(4)




#backtest_data.reset_index(drop=True, inplace=True)

print(backtest_data.head(50))
print(backtest_data.tail(5))

backtest = Backtest(backtest_data, kCluster, commission=0.002)

backtest.run()
backtest.plot()
Index(['Date', 'Symbol', 'Class Symbol', 'Root Symbol', 'Underlying Symbol',
       'Strike Price', 'Expiry Date', 'Call/Put', 'Ins. Type', 'Bid Price',
       'Ask Price', 'Bid Size', 'Ask Size', 'Last Price', 'Volume',
       'Last Close Price', 'Net Change', 'Open Price', 'High Price',
       'Low Price', 'Total Value', 'Nb. Trades', 'Settlement Price',
       'Open Interest', 'Implied Volatility'],
      dtype='object')
0     2019-05-01
191   2019-05-02
382   2019-05-03
575   2019-05-06
742   2019-05-07
Name: Date, dtype: datetime64[ns]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, -1, 0]
           Date   Open   High    Low   Close
0    2019-05-01  21.44  21.50  21.27  21.290
191  2019-05-02  21.24  21.30  20.50  21.290
382  2019-05-03  20.92  21.05  20.80  20.790
575  2019-05-06  20.50  21.11  20.47  20.980
742  2019-05-07  21.10  21.22  20.48  21.110
909  2019-05-08  20.50  20.77  20.50  20.550
1098 2019-05-09  20.56  20.65  19.88  20.590
1287 2019-05-10  19.95  20.34  19.78  19.970
1482 2019-05-13  20.05  20.05  19.34  20.330
1653 2019-05-14  19.79  20.16  19.76  19.440
1836 2019-05-15  19.93  20.24  19.75  20.070
2029 2019-05-16  20.31  20.42  20.20  20.210
2222 2019-05-17  20.19  20.42  19.99  20.320
2415 2019-05-21  20.01  20.30  19.99  20.040
2578 2019-05-22  20.12  20.66  20.12  20.210
2759 2019-05-23  20.29  20.31  19.72  20.400
2942 2019-05-24  19.93  20.22  19.93  19.820
3125 2019-05-27  20.00  20.23  20.00  19.980
3282 2019-05-28  20.15  20.31  20.00  20.230
3439 2019-05-29  19.93  19.96  19.48  20.100
3614 2019-05-30  19.65  19.80  19.26  19.605
3793 2019-05-31  19.18  19.18  18.58  19.320
3974 2019-06-03  18.61  18.78  17.89  18.620
4141 2019-06-04  18.15  18.78  18.10  17.990
4322 2019-06-05  19.19  19.21  18.53  18.780
4521 2019-06-06  18.88  18.88  18.44  18.810
4720 2019-06-07  18.68  19.08  18.61  18.610
4919 2019-06-10  19.35  19.60  19.20  18.930
5092 2019-06-11  19.59  19.60  18.94  19.460
5267 2019-06-12  19.09  19.13  18.80  19.150
5460 2019-06-13  19.17  19.20  18.57  19.085
5653 2019-06-14  18.56  18.60  18.30  18.595
5848 2019-06-17  18.41  18.61  18.23  18.410
6015 2019-06-18  18.72  18.89  18.64  18.580
6182 2019-06-19  18.75  18.92  18.64  18.730
6359 2019-06-20  18.96  19.05  18.79  18.830
6536 2019-06-21  18.78  18.78  18.15  19.020
6713 2019-06-24  18.68  18.76  18.17  18.580
6868 2019-06-25  18.43  18.44  18.11  18.450
7025 2019-06-26  18.15  18.20  18.01  18.120
7204 2019-06-27  18.07  18.27  17.99  18.160
7383 2019-06-28  18.33  18.44  18.20  18.210
7562 2019-07-02  18.47  18.47  18.01  18.270
7715 2019-07-03  18.10  18.32  17.89  18.220
7886 2019-07-04  18.24  18.25  18.06  18.260
8057 2019-07-05  18.14  18.20  18.06  18.190
8228 2019-07-08  18.08  18.08  17.80  18.140
8375 2019-07-09  17.81  17.91  17.61  17.860
8522 2019-07-10  17.86  17.94  17.64  17.830
8687 2019-07-11  17.67  17.71  17.23  17.640
            Date   Open    High    Low  Close
17871 2019-09-25  13.00  13.140  12.68  13.05
18064 2019-09-26  13.32  13.320  12.90  13.08
18257 2019-09-27  12.76  12.825  12.33  13.08
18450 2019-09-30  12.34  12.340  11.85  12.37
18637 2019-10-01  11.96  12.040  11.37  11.90
Int64Index([    0,   191,   382,   575,   742,   909,  1098,  1287,  1482,
             1653,
            ...
            17018, 17195, 17374, 17557, 17714, 17871, 18064, 18257, 18450,
            18637],
           dtype='int64', length=106)
/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py:58: UserWarning: Data index is not datetime. Assuming simple periods.