OpenApi-5p / py5paisa

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

big problem with bracket order #145

Open vinayakbhovi opened 2 years ago

vinayakbhovi commented 2 years ago

Description

i am trying to place a bracket order in options which was placed successfully, the buy , stoploss , but there is a problem with the sell order that is the sell order is placed AT MARKET price , that is at what price i will buy it , it will be soled at that same price...

What I Did

    test_order=bo_co_order(scrip_code = int(Scripcode),BuySell='B',Qty=25, LimitPriceInitialOrder= buyprice, TriggerPriceInitialOrder=0, LimitPriceProfitOrder= sellprice,TriggerPriceForSL=trgstoploss,LimitPriceForSL= stoploss,ExchType='D',Exch='N',RequestType='P',AtMarket=False)
    details = client.bo_order(test_order)

Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.

output that i got

client.order_book()

34  N   N   N   668394232   /Date(1647845482163+0530)/  B   S   0   N   1700000042556322    ... N   80.00   72.40   70.95   0   53245   BANKNIFTY 24 Mar 2022 PE 34500.00   36848   25  N

35  N   N   N   668394308   /Date(1647845485950+0530)/  S   S   0   N   1700000042564879    ... N   0.00    0.00    0.00    0   53245   BANKNIFTY 24 Mar 2022 PE 34500.00   36848   0   Y

36  N   N   Y <( this is the problem)   668394310   /Date(1647845486070+0530)/  S   S   0   N   1700000042565022    ... N   0.00    0.00    0.00    0   53245   BANKNIFTY 24 Mar 2022 PE 34500.00   33796   25  N

the row 34 is the buy order of the bracket order 

the row 35 is the stoploss order of the bracket order

the row 36 is the sell order of the bracket order 

in row 36   third column the AtMarket parameter is set to Y (yes) by default and we cant even change it .so
the sell order is placed at the buy price immediately....
kumarchinmaya116 commented 2 years ago

hi @vinayakbhovi , Are you still able to place bracket orders, because I am not able to even place a bracket order. The code throws an error: 'NameError: name 'bo_co_order' is not defined'. Did you get any error like this. If so, can you please help me figuring out a way around this issue.

Thanks Chinmaya Kumar Rath

Sushantmkarande commented 2 years ago

hi @vinayakbhovi , Are you still able to place bracket orders, because I am not able to even place a bracket order. The code throws an error: 'NameError: name 'bo_co_order' is not defined'. Did you get any error like this. If so, can you please help me figuring out a way around this issue.

Thanks Chinmaya Kumar Rath

They have changed it Bo_co_order. import it from Order