Idirect-Tech / Breeze-Python-SDK

The official Python client library for the ICICI Securities trading APIs
MIT License
60 stars 30 forks source link

Error in Squareoff #72

Open logic-is-magic opened 8 months ago

logic-is-magic commented 8 months ago

my code

def exitshort(): global PE_sell_trigger

 pe_sell_exit = breeze.square_off(exchange_code="NFO",
                     product="options",
                     stock_code=STOCK,
                     expiry_date=str(EXP_DATE) + "T06:00:00.000Z",
                     right="Put",
                     strike_price=STK_PRICE,
                     action="buy",
                     order_type="market",
                     validity="day",
                     stoploss="0",
                     quantity=QTY,
                     price="0",
                     validity_date=str(DATE) + "T06:00:00.000Z",
                     trade_password="",
                     disclosed_quantity="0")   
 PE_sell_trigger = 0
 print(pe_sell_exit)

Error i am getting

Exception in thread Thread-424 (_handle_eio_message): Traceback (most recent call last): File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/usr/lib/python3.10/threading.py", line 953, in run self._target(*self._args, *self._kwargs) File "/home/sudheerch/.local/lib/python3.10/site-packages/socketio/client.py", line 705, in _handle_eio_message self._handle_event(pkt.namespace, pkt.id, pkt.data) File "/home/sudheerch/.local/lib/python3.10/site-packages/socketio/client.py", line 581, in _handle_event r = self._trigger_event(data[0], namespace, data[1:]) File "/home/sudheerch/.local/lib/python3.10/site-packages/socketio/client.py", line 629, in _trigger_event return self.handlers[namespace]event File "/home/sudheerch/.local/lib/python3.10/site-packages/breeze_connect/breeze_connect.py", line 80, in on_message self.breeze.on_ticks(data) File "/home/sudheerch/bot/Breeze BOT/Zero_PE_BUY_SELLpy", line 88, in on_ticks exitshort() File "/home/sudheerch/bot/Breeze BOT/Zero_PE_BUY_SELLpy", line 150, in exitshort pe_sell_exit = breeze.square_off(exchange_code="NFO", File "/home/sudheerch/.local/lib/python3.10/site-packages/breeze_connect/breeze_connect.py", line 892, in square_off return self.api_handler.square_off(source_flag, stock_code, exchange_code, quantity, price, action, order_type, validity, stoploss, disclosed_quantity, protection_percentage, settlement_id, margin_amount, open_quantity, cover_quantity, product, expiry_date, right, strike_price, validity_date, trade_password, alias_name,order_reference) TypeError: ApificationBreeze.square_off() takes 23 positional arguments but 24 were given