osparamatrix / ks-orderapi-python

47 stars 59 forks source link

How to place a Bracket Order and what are the parameters? #23

Open BHUMITKATHPALIA opened 3 years ago

jerinkalexander commented 3 years ago

Bracket order API not yet ready as per the response i got from the support team.

kalilinux-png commented 3 years ago

sample code ideas

`def bracket_order(instrument_token=x-y-x ,stoploss=x ,book_profit=y, price=market_price ,quantity=1):

normal order first at a particular price

     clientplace_order(order_type = "N", instrument_token=instrument_token, transaction_type ='BUY',
                   quantity = 1, price = 0, disclosed_quantity = 0, trigger_price = 0)
     place_order(order_type = "N", instrument_token=instrument_token, transaction_type ='SELL',
                   quantity = QUANTITY , price = BOOKPROFIT , disclosed_quantity = 0, trigger_price = BOOKPROFIT)
     place_order(order_type = "N", instrument_token=instrument_token, transaction_type ='SELL',
                   quantity = QUANTITY , price = STOPLOSS, disclosed_quantity = 0, trigger_price = STOPLOSS)

`