Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ client.place_order(test_order)
By default all orders are normal orders, pass `ahplaced=Y` to place offline orders.

```py
from py5paisa.order import Order, OrderType, AHPlaced
from py5paisa.order import Order, OrderType, AHPlaced, Bo_co_order
test_order = Order(order_type='B',exchange='N',exchange_segment='C', scrip_code=1660, quantity=1, price=205,is_intraday=False, ahplaced='Y',remote_order_id="tag")
```

Expand Down Expand Up @@ -168,15 +168,15 @@ client.cancel_bulk_order(cancel_bulk)

For placing Braket order
```py
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)
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)
```
Note:For placing Bracket order in FNO segment pass ExchType='D'

For Modifying Bracket Order only for Initial order (entry)
```py
test_order=bo_co_order(scrip_code=1660,BuySell='B',Qty=1, LimitPriceInitialOrder=203,TriggerPriceInitialOrder=0,LimitPriceProfitOrder=208.0,TriggerPriceForSL=202,LimitPriceForSL=201,ExchType='C',Exch='N',RequestType='M',AtMarket=False,ExchOrderId='12345678')
test_order=Bo_co_order(scrip_code=1660,BuySell='B',Qty=1, LimitPriceInitialOrder=203,TriggerPriceInitialOrder=0,LimitPriceProfitOrder=208.0,TriggerPriceForSL=202,LimitPriceForSL=201,ExchType='C',Exch='N',RequestType='M',AtMarket=False,ExchOrderId='12345678')

client.bo_order(test_order)

Expand Down
10 changes: 6 additions & 4 deletions py5paisa/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ def __init__(self, order_type: str, quantity: int, exchange: str,
exchange_segment: str, price: float ,is_intraday: bool ,
remote_order_id: str = "tag", scrip_code: int=0, exch_order_id: int = 0,
stoploss_price: float = 0, is_stoploss_order: bool = False, ioc_order: bool = False,scripdata: str='',
order_id: int = 0,vtd: str = f"/Date({NEXT_DAY_TIMESTAMP})/",
ahplaced: str= 'N',IsGTCOrder:bool =False,IsEOSOrder:bool =False):
order_id: int = 0,vtd: str = f"/Date({NEXT_DAY_TIMESTAMP})/",AtMarket: bool = False,
ahplaced: str= 'N',IsGTCOrder:bool =False,IsEOSOrder:bool =False,order_for: str="M"):

self.exchange = exchange
self.exchange_segment = exchange_segment
Expand All @@ -90,13 +90,15 @@ def __init__(self, order_type: str, quantity: int, exchange: str,
self.ioc_order = ioc_order
self.is_intraday = is_intraday
self.vtd = vtd
self.AtMarket = AtMarket
self.ahplaced = ahplaced
self.scripData=scripdata
self.IsGTCOrder=IsGTCOrder
self.IsEOSOrder=IsEOSOrder

self.order_for = order_for


class Bo_co_order:
class bo_co_order:

def __init__(self,scrip_code: int, Qty: int,LimitPriceInitialOrder:float,TriggerPriceInitialOrder:float
,LimitPriceProfitOrder:float,BuySell:str,Exch: str,ExchType: str,RequestType: str,LimitPriceForSL:float,
Expand Down