py5paisa icon indicating copy to clipboard operation
py5paisa copied to clipboard

Error or Exception while placing new Orders with latest SDK

Open SomaKonijeti opened this issue 2 years ago • 5 comments

  • 5paisa Python SDK version: 0.5.3
  • Python version: 3.9
  • Operating System: Windows and Ubuntu

Description

Error while placing fresh orders with latest SDK version.

What I Did

test_order = Order(order_type='B',exchange='N',exchange_segment='D',scrip_code=43571,quantity=1,price=1,is_intraday=True,remote_order_id="Test") client.place_order(test_order)

Order Issue

SomaKonijeti avatar Jul 13 '22 10:07 SomaKonijeti

@SomaKonijeti please follow updated documentation

5paisa avatar Jul 16 '22 12:07 5paisa

How do I place market order with new API. When I set Price=0, SDK throws "please enter valid input" error.

paisa5.place_order(OrderType='B', Exchange='N', ExchangeType='D', ScripCode=82221, Qty=25, Price=0)

mithunpradeep avatar Aug 01 '22 05:08 mithunpradeep

How do I place market order with new API. When I set Price=0, SDK throws "please enter valid input" error.

paisa5.place_order(OrderType='B', Exchange='N', ExchangeType='D', ScripCode=82221, Qty=25, Price=0)

Hi, Market orders are disabled in last major update.

You can use Basket orders to place Market Orders.

Hope this will help.

SomaKonijeti avatar Aug 02 '22 04:08 SomaKonijeti

@SomaKonijeti the same error springs up when placing BO, even after following the documentation. test_order=bo_co_order(scrip_code=1660,BuySell='B',Qty=1, LimitPriceInitialOrder=205,TriggerPriceInitialOrder=0,LimitPriceProfitOrder=215.0,TriggerPriceForSL=203,LimitPriceForSL=202,ExchType='C',Exch='N',RequestType='P',AtMarket=False)

client.bo_order(test_order)

Traceback (most recent call last): File "", line 1, in TypeError: bo_order() takes 1 positional argument but 2 were given

kvekka avatar Feb 26 '23 15:02 kvekka

anybody addressing these issues?

sshiremath2000 avatar Aug 23 '23 05:08 sshiremath2000