From 07772512eb5ca888090d18af09a8ab68760b47b0 Mon Sep 17 00:00:00 2001 From: Dedaniya08 Date: Fri, 1 Jul 2022 14:12:46 +0530 Subject: [PATCH 1/2] class Order is missing attributes order_for and AtMarket as mentioned in README.md --- py5paisa/order.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/py5paisa/order.py b/py5paisa/order.py index 3ea5b04b..675b26ae 100644 --- a/py5paisa/order.py +++ b/py5paisa/order.py @@ -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 @@ -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, From ce20dc07f1b14eb37f5521794d5635d93e255c00 Mon Sep 17 00:00:00 2001 From: Akshay Dedaniya <54439564+Dedaniya08@users.noreply.github.com> Date: Fri, 1 Jul 2022 14:30:16 +0530 Subject: [PATCH 2/2] Update README.md The class Bo_co_order was wrong labelled as bo_co_order and also not imported from order.py --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5ba40a44..ba379e9f 100644 --- a/README.md +++ b/README.md @@ -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") ``` @@ -168,7 +168,7 @@ 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) ``` @@ -176,7 +176,7 @@ 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)