TradeViaPython / Kite_Zerodha

156 stars 108 forks source link

place_order API is not working, tried many times #12

Open Pravein2802 opened 1 year ago

Pravein2802 commented 1 year ago

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 1) How can we avoid this error ? 2) 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

jenish99 commented 1 year ago

check with price=0

github062025 commented 1 year ago

check with price=0

Traceback (most recent call last): File "c:/Users/himad/OneDrive/Desktop/Kite_Zerodha-main/experimental.py", line 19, in order = kite.place_order(variety=kite.VARIETY_REGULAR, File "c:\Users\himad\OneDrive\Desktop\Kite_Zerodha-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

Prabhuakur commented 1 year ago

I tried using price=0 but no luck. it is giving the same error

hgillh commented 1 year ago

I am facing the same issue. As I check the response object, it's giving following error 'Request method not allowed'