OpenApi-5p / py5paisa

Official Python SDK for 5paisa APIs natively written in VB .NET
https://5paisa.github.io
91 stars 68 forks source link

BO order for options #51

Closed mpunekar closed 3 years ago

mpunekar commented 3 years ago

Description

Is it possible to place BO order for options? I tried to use correct script code which works with regular order but it doesn't work with bo_co_order and bo_order. The problem seems to be that I can't pass exchange and exchange_segment to bo_co_order. Can you please provide appropriate function calls?

coder-amogh commented 3 years ago

Can you paste the code?

mpunekar commented 3 years ago

order_pe = bo_co_order(scrip_code=41303, BuySell='S',Qty=75, LimitPriceInitialOrder=204,TriggerPriceInitialOrder=0,LimitPriceProfitOrder=208.0,TriggerPriceForSL=opt_pe_cmt*1.25,RequestType='P',AtMarket=True) order_pe_response = client.bo_order(order_pe) print(order_pe_response)

Script code 41303 for "BANKNIFTY 06 MAY 2021 PE 32800.00" was found through client.fetch_market_feed and works with regualr order and place order methods.

Response:

19:16:55 | Order information not found {'AddReqMgn': 0, 'AvlbMgn': 0, 'BrokerOrderIDNormal': 0, 'BrokerOrderIDProfit': 0, 'BrokerOrderIDSL': 0, 'ClientCode': '', 'Exch': '', 'ExchOrderID': 0, 'ExchType': '', 'FirstOrderPrice': 0, 'FirstOrderTriggerPrice': 0, 'LocalOrderIDNormal': 0, 'LocalOrderIDProfit': 0, 'LocalOrderIDSL': 0, 'Message': 'Order information not found', 'ProfitPrice': 0, 'RMSResponseCode': 1, 'RMSStatus': 1, 'SLOrderPrice': 0, 'SLOrderTriggerPrice': 0, 'Time': 0, 'TrailingSL': 0}

coder-amogh commented 3 years ago

Do you have enough margin? Is the Qty 75 or 50? NSE has changed the lot size from 75 to 50. Try with that?

mpunekar commented 3 years ago

Do you have enough margin? Is the Qty 75 or 50? NSE has changed the lot size from 75 to 50. Try with that?

I am a regular trader and trade up to 10 lots a day whereas I don't think you even trade options. I appreciate that you want to help but I think you have no idea about this problem. So please don't waste your and my time!

coder-amogh commented 3 years ago

I am a regular trader and trade up to 10 lots a day whereas I don't think you even trade options. I appreciate that you want to help but I think you have no idea about this problem. So please don't waste your and my time!

Ok