-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbacktest.py
31 lines (26 loc) · 845 Bytes
/
backtest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import zipline
from zipline.data.bundles import register
import warnings
plt.style.use('seaborn')
plt.rcParams['figure.figsize'] = [16, 9]
plt.rcParams['figure.dpi'] = 200
warnings.simplefilter(action='ignore', category=FutureWarning)
from zipline.data.bundles.csvdir import csvdir_equities
start_session = pd.Timestamp('2020-01-29', tz='utc')
end_session = pd.Timestamp('2020-07-01', tz='utc')
# register the bundle
register(
'ftx', # name we select for the bundle
csvdir_equities(
# name of the directory as specified above (named after data frequency)
['minutely'],
# path to directory containing the
'./',
),
calendar_name='XAMS', # Euronext Amsterdam
start_session=start_session,
end_session=end_session
)