Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ticker_base_asset_d=['MX']
- Month_OPT_d = ['A', 'B', 'C']
- Strikes_d = [[5000,160000,370000],[50,1700,3700],[2500,27500,230000]]
- Ticker_d=[]
- for i in range(len(Ticker_base_asset_d)):
- Month_d=[]
- for j in range(len(Month_OPT_d)):
- data_d=[]
- for h in range(Strikes_d[i][1], Strikes_d[i][2]+1, Strikes_d[i][0]):
- url=f'https://iss.moex.com/iss/engines/futures/markets/options/\
- securities/{Ticker_base_asset_d[i]}{h}B{Month_OPT_d[j]}9/candles.csv?from=\
- 2019-01-01&till=2020-01-01&interval=24&iss.meta=on'
- data_sheet=[]
- try:
- data_sheet = pd.read_csv(url,sep=";",skiprows=3)
- except Exception:
- pass
- data_d.append(data_sheet)
- Month_d.append(data_d)
- Ticker_d.append(Month_d)
- Вывод
- [[[],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- Empty DataFrame
- Columns: [1000, 1775, 1775.1, 1000.1, 0, 90, 2019-01-17 00:00:00, 2019-01-17 23:59:59]
- Index: [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- []],
- [[],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- []],
- [[],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- Empty DataFrame
- Columns: [325, 325.1, 325.2, 325.3, 0, 1, 2019-03-18 00:00:00, 2019-03-18 23:59:59]
- Index: [],
- Empty DataFrame
- Columns: [325, 325.1, 325.2, 325.3, 0, 1, 2019-03-12 00:00:00, 2019-03-12 23:59:59]
- Index: [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- [],
- []]]
Add Comment
Please, Sign In to add comment