-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbreeze.py
71 lines (35 loc) · 1.2 KB
/
breeze.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
pip install breeze-connect==1.0.12
# In[ ]:
from breeze_connect import BreezeConnect
session_key = 'session_key'
api_key = 'your_api_key'
api_secret = 'your_secret_key'
breeze = BreezeConnect(api_key=api_key)
breeze.generate_session(api_secret=api_secret,session_token=session_key)
# In[ ]:
breeze.get_funds()
# In[ ]:
import pandas as pd
res = breeze.get_historical_data(interval="1minute",
from_date= "2019-03-15T07:00:00.000Z",
to_date= "2019-03-28T07:00:00.000Z",
stock_code="CNXBAN",
exchange_code="NFO",
product_type="options",
expiry_date="2019-03-28T07:00:00.000Z",
option_type="call",
strike_price="29100")
histdf = pd.DataFrame(res['Success'])
histdf
# In[ ]:
# In[ ]:
tokendf = pd.read_csv('https://traderweb.icicidirect.com/Content/File/txtFile/ScripFile/StockScriptNew.csv')
tokendf
# In[ ]:
listSymbols = tokendf[tokendf.EC == 'NFO'].NS.unique()
listSymbols
# In[ ]:
tokendf[tokendf.NS == 'NIFTY BANK']