-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBBL.py
More file actions
40 lines (29 loc) · 773 Bytes
/
BBL.py
File metadata and controls
40 lines (29 loc) · 773 Bytes
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
32
33
34
35
36
37
38
39
import config as cfg
from xbbg import blp
import xlwings as xw
import pandas as pd
import numpy as np
from datetime import date
def getbldata(tkrs, flds, start_date, end_date, per='D'):
res = blp.bdh(
tkrs,
flds,
start_date=start_date,
end_date=end_date,
Per=per
)
return res
if __name__ == "__main__":
start = date(2022, 9, 5)
to = date.today()
tickers = [
"SPX Index",
# "SX5E Index",
# "KOSPI2 Index",
# "SHSZ300 Index",
# "NKY Index",
# "HSCEI Index"
]
fields = ['30DAY_IMPVOL_100.0%MNY_DF', '60DAY_IMPVOL_100.0%MNY_DF']
df = getbldata(tickers, fields, start, to)
print(df)