kite_zerodha's People
Forkers
sasi143 swapdha raviudal akasurde rstekale satishkrsing anirudh-12 nselvamca saurabhchandrapatel citrus09 raaghulr mkaladi raval1981 sha1509 abhimanyudas747 abcb2011 kishanmishra1 shajmanfaiz anuphw amitmaity harsh572 ankitpro amit84git parikshitsg sanjeevsenapati chinmayghegde parthapaul7 sameergupta4873 themistysky babithg maverick00007 tarunw07 pramodrwt raushan79 remofinds harshdeepratnani pv-ajay-thota vishaletm crypt0inf0 arveymenon elicherla01 unosonu anasharps dnyanesh1703 ajaysekhri abkkm omagrawa projectsrougedoll prakash-prasad shekhar8102 vikash-sharma-php udaypratapyati mogan92 milan00137 rohitnrl navinkmrsingh krsna24x7 hkuralkar sagar123pawar tahseenjamal sajinct tatiyabichhoo nandish486 pandasamanvaya kevinknash omkarmakar neevgujral7 anupamram sg48 sivasankarch surajar994 rahul-kr-gupta tarakbluru kapil987 suv2013 mauj4in atharvachavan grcstack bngopale prithviramg vijaykumargv gopinathshiva tgowthambits laraiv12 mithunkamat akarsh218 dimpy2503 sahilbakoru ujjwalb2 amitgcse avinashsk44 taltaf913 subhantech pmvamsi-coder jchavara ageofthegit webdevelopersunil harshyadav0011 bidreshivaprasad ds-1991-ytkite_zerodha's Issues
Not able to place order
When i execute place order, Getting below error:
File "C:\Users\Shivani\AppData\Local\Temp\ipykernel_42316\2603481076.py", line 1, in
order = kite.place_order(variety=kite.VARIETY_REGULAR,
File "E:\tradingincome\kite_trade.py", line 135, in place_order
order_id = self.session.post(f"{self.root_url}/orders/{variety}",
TypeError: 'NoneType' object is not subscriptable
I am getting exchange value not given although I have given the value
URL: https://api.kite.trade/orders/regular
HTTP METHOD USED : POST
Authorization: enctype RXh5wUmztLGjGbrGSN/92Gd
PayLoad:
{
"variety": "regular",
"exchange": "NSE",
"tradingsymbol": "NIFTY23SEP19300PE",
"transaction_type": "BUY",
"quantity": 1,
"product": "NRML",
"order_type": "MARKET",
"price": null,
"validity": null,
"disclosed_quantity": null,
"trigger_price": null,
"squareoff": null,
"stoploss": null,
"trailing_stoploss": null
}
Response received:
{
"status": "error",
"message": "Missing or empty field exchange
",
"data": null,
"error_type": "InputException"
}
Can someone help?
How to sell the after i buy, NFO : option chain
I purchased BANK NIFTY 42000 CE then if i want to set target or stoploss , how can i do , because if i execute sell order it is showing option selling
GotThis Error Today
Traceback (most recent call last):
File "/home/ubuntu/Kite_Zerodha/main.py", line 21, in
data = kite.quote(["NSE:BANKBARODA"])
File "/home/ubuntu/Kite_Zerodha/kite_trade.py", line 89, in quote
data = self.session.get(f"{self.root_url}/quote", params={"i": instruments}, headers=self.headers).json()["data"]
KeyError: 'data'
Weekly Option Place Order Issue
Hello,
Getting below error while placing order for Weekly Option (Bank Nifty) : Able to fetch stream data for every one minute but placing order is creating error.
Is it because of no subscribe Kite API
Code :
kite = KiteApp(enctoken=enctoken) # Using from kite_trade import * to access Kite.
Symbol = kite.quote(["NFO:BANKNIFTY23D0644500PE"])
order = kite.place_order(variety=kite.VARIETY_REGULAR,
exchange=kite.EXCHANGE_NFO,
tradingsymbol= Symbol,
transaction_type=kite.TRANSACTION_TYPE_BUY,
quantity=1,
product=kite.PRODUCT_MIS,
order_type=kite.ORDER_TYPE_MARKET,
price=None,
validity=None,
disclosed_quantity=None,
trigger_price=None,
squareoff=None,
stoploss=None,
trailing_stoploss=None,
tag="RVS")
print(order)
Error:
Request failed with status code: 400
b'{"status":"error","message":"The instrument you are placing an order for has either expired or does not exist.","data":null,"error_type":"InputException"}'
None
ability to fetch indicators
ablity to fetch indicators like vwap ,supertrend etc
Basket order
How can we place a basket orders with stop loss?
After some time I get connection error
Traceback (most recent call last):
File "C:\Users\HP\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\connectionpool.py", line 790, in urlopen
response = self._make_request(
^^^^^^^^^^^^^^^^^^^
File "C:\Users\HP\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\connectionpool.py", line 536, in _make_request
response = conn.getresponse()
^^^^^^^^^^^^^^^^^^
File "C:\Users\HP\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\urllib3\connection.py", line 454, in getresponse
httplib_response = super().getresponse()
^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\http\client.py", line 1378, in getresponse
response.begin()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\http\client.py", line 318, in begin
version, status, reason = self._read_status()
^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\http\client.py", line 287, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response
During handling of the above exception, another exception occurred:
Need code for Get GTT and Place GTT
Looking for code to place GTT and Get List of GTT
Does the enctoken expires ?
Check existing order and place trailing SL
Can we check existing active order and place trailing SL to that trade?
Holdings function
Please merge this in master branch
def holdings(self):
holdings = self.session.get(f"{self.root_url}/portfolio/holdings", headers=self.headers).json()["data"]
return holdings
print(kite.holdings())
It seem its no more working.
getting bad request error . {'status': 'error', 'message': 'Bad Request', 'error_type': 'InputException'}
kite.ltp("NSE:INFY")
it used to work.
not any more for me.
place_order API is not working, tried many times
Dear TradeViaPython Team,
Thank you so much for your content on youtube and github, I am your follower and learning a lot from you. Keep up good work!
I am having trouble while testing place_order API described in the github description, I just copied the example and test it without modifying anything, but it is throwing error. Kindly suggest
- How can we avoid this error ?
- If this error is unavoidable, how can we handle inside the code ?
Error description is below:
API Triggered:
Place Order
order = kite.place_order(variety=kite.VARIETY_REGULAR,
exchange=kite.EXCHANGE_NSE,
tradingsymbol="ACC",
transaction_type=kite.TRANSACTION_TYPE_BUY,
quantity=1,
product=kite.PRODUCT_MIS,
order_type=kite.ORDER_TYPE_MARKET,
price=None,
validity=None,
disclosed_quantity=None,
trigger_price=None,
squareoff=None,
stoploss=None,
trailing_stoploss=None,
tag="TradeViaPython")
Error received:
Traceback (most recent call last):
File "D:\INVESTMENTS\ALGO\code _v7.5\main\swing_trade_nifty.py", line 42, in
order = kite.place_order(variety=kite.VARIETY_REGULAR,
File "D:\INVESTMENTS\ALGO\code _v7.5\main\kite_trade.py", line 134, in place_order
order_id = self.session.post(f"{self.root_url}/orders/{variety}",
TypeError: 'NoneType' object is not subscriptable
how to add another method into kite_trader.py ?
I tried adding the ohlc method suggested in the below conversation. but still getting error
AttributeError: 'KiteApp' object has no attribute 'ohlc'
Any tips on how to make it work ?
Not able to place order
I have used the exact same code as given in GITHUB to place the order
Traceback (most recent call last):
File "C:\Users\HP\KiteTrading.py", line 25, in
order = kite.place_order(variety=kite.VARIETY_REGULAR,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\HP\kite_trade.py", line 134, in place_order
order_id = self.session.post(f"{self.root_url}/orders/{variety}",
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable
issue while fetching historic data
all the fuctions working for me except fetching historic data. The error:-
- Traceback (most recent call last):
- File "C:\Users\admin\Downloads\kite\main.py", line 11, in
-
print(kite.historical_data(instrument_token, from_datetime, to_datetime, interval, continuous=False, oi=False))
- File "C:\Users\admin\Downloads\kite\kite_trade.py", line 102, in historical_data
-
lst = self.session.get(
- TypeError: 'NoneType' object is not subscriptable
Is the kite api has rate limiter ?
I am going to fetch orders in a loop will this trigger api to stop me to fetch data after some time ?
Order Margins
Can you give code to be added to kite_trade.py file so that order margins can be fetched to check how much margin is required for a particular order?
Connection error
Connection error: 1006 - connection was closed uncleanly (WebSocket connection upgrade failed (400 - BadRequest))
Connection closed: 1006 - connection was closed uncleanly (WebSocket connection upgrade failed (400 - BadRequest))
Connection error: 1006 - connection was closed uncleanly (WebSocket connection upgrade failed (400 - BadRequest))
Connection closed: 1006 - connection was closed uncleanly (WebSocket connection upgrade failed (400 - BadRequest))
Looks like Zerodha is force throttling requests. API requests are stuck. Earlier I was getting historical data every 1 min but now requests are stuck
Looks like Zerodha is force throttling requests. API requests are stuck. Earlier I was getting historical data every 1 min but now requests are stuck
Kite
Quote Query
Hi I had ran below code to get quote detail of NIFTY SEP future,
print(kite.quote(["NFO:NIFTY29SEPFUT"]))
I am getting empty dictionary, But if i run for option strike i am getting quote details.
Get Historical Data not update in while loop... every time same json output ...
for Ex.
instrument_token = 9604354
from_datetime = datetime.datetime.now() - datetime.timedelta(days=7) # From last & days
to_datetime = datetime.datetime.now()
interval = "5minute"
while True:
t.sleep(1)
if datetime.now().minute % 5 == 0 and datetime.now().second == 10:
get_data = kite.historical_data(instrument_token, from_datetime, to_datetime, interval, continuous=False, oi=False)
print(get_data)
1.Profile 2.holdings
If possible kindly add profile attribute in kiteapp
Ability to fetch OHLC data for a given instrument
Please introduce ohlc method in the KiteApp with the below implementation
def ohlc(self, instruments):
data = self.session.get(f"{self.root_url}/quote/ohlc", params={"i": instruments}, headers=self.headers).json()["data"]
return data
basket order
How can we modify 'kite_trade.py' file for placing basket order with any number of legs?
Intervals in historical data fetch
Where can i find intervals available for historical data fetch. I am unable to get data for one minute
Need One More Function to Fetch Order Status is this possible?
Not able to place order
HI,
getting this error while placing order.
ERROR:"TypeError: KiteApp.place_order() got an unexpected keyword argument 'squareoff'"
using this code :
order = kite.place_order(variety=kite.VARIETY_REGULAR,
exchange=kite.EXCHANGE_NSE,
tradingsymbol="ACC",
transaction_type=kite.TRANSACTION_TYPE_BUY,
quantity=1,
product=kite.PRODUCT_MIS,
order_type=kite.ORDER_TYPE_MARKET,
price=None,
validity=None,
disclosed_quantity=None,
trigger_price=None,
squareoff=None,
stoploss=None,
trailing_stoploss=None,
tag="TradeViaPython")
print(order)
thanks in advance
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.