NORMAL ORDER PLACED INSTEAD OF BRACKET ORDER

MAG
Hi,

I wanted to place a bracket order via the kiteconnect python client api. But it placed a normal order which did not squareoff when the target was reached. I had to exit the order manually. Can you please let me know what I am doing wrong?

The code and output from kite.orders are given below:
This is what my code looked like"
order_id = kite.order_place(
tradingsymbol=AJANTPHARM,
exchange="NSE",
transaction_type="BUY",
order_type="LIMIT",
quantity=1,
product="MIS",
price=RecomBuyPrice,
squareoff_value=targetPoints,
stoploss_value=StopLossPoints
)
** RecomBuyPrice, targetPoints and StopLossPoints are variables containing actual values.

Prettyprint Output of Kite.orders is:
[ { 'average_price': 1642.35,
'cancelled_quantity': 0,
'disclosed_quantity': 0,
'exchange': 'NSE',
'exchange_order_id': '*****00001147927',
'exchange_timestamp': '2017-01-24 10:03:53',
'filled_quantity': 1,
'instrument_token': 2079745,
'market_protection': 0,
'order_id': '*****4000130090',
'order_timestamp': '2017-01-24 10:03:53',
'order_type': 'LIMIT',
'parent_order_id': None,
'pending_quantity': 0,
'placed_by': '******',
'price': 1643.1,
'product': 'MIS',
'quantity': 1,
'status': 'COMPLETE',
'status_message': None,
'tag': None,
'tradingsymbol': 'AJANTPHARM',
'transaction_type': 'BUY',
'trigger_price': 0,
'validity': 'DAY',
'variety': 'regular'},
{ 'average_price': 1683,
'cancelled_quantity': 0,
'disclosed_quantity': 0,
'exchange': 'NSE',
'exchange_order_id': '*****00001197359',
'exchange_timestamp': '2017-01-24 10:06:23',
'filled_quantity': 1,
'instrument_token': 2079745,
'market_protection': 0,
'order_id': '*****4000134223',
'order_timestamp': '2017-01-24 10:06:23',
'order_type': 'MARKET',
'parent_order_id': None,
'pending_quantity': 0,
'placed_by': '*****',
'price': 0,
'product': 'MIS',
'quantity': 1,
'status': 'COMPLETE',
'status_message': None,
'tag': None,
'tradingsymbol': 'AJANTPHARM',
'transaction_type': 'SELL',
'trigger_price': 0,
'validity': 'DAY',
'variety': 'regular'}]
  • MAG
    MAG edited January 2017
    Got it working. For those who would review this thread later, I present my updated code.
            order_id = kite.order_place(
    exchange="NSE",
    tradingsymbol=InstName,
    transaction_type="BUY",
    quantity=1,
    price=RecomBuyPrice,
    product="MIS",
    order_type="LIMIT",
    validity="DAY",
    squareoff_value=targetPoints,
    stoploss_value=StopLossPoints,
    trailing_stoploss=StopLossPoints,
    variety="bo" # this is the additional line.
    )
    print('Order Id is : '+order_id)
    ** InstName is a variable containing exchange code for eg ASIANPAINT or JINDALSTEL
    Similarly targetPoints, StopLossPoints are variables containing real numbers rounded off to .05 (tick size)
This discussion has been closed.