如何在Angelone Smartapi中下达括号订单

huangapple go评论71阅读模式
英文:

How can I place a Bracket Order in Angelone Smartapi

问题

我有以下方法 -

def place_order(token, symbol, qty, buy_sell, ordertype, price, variety='NORMAL', exch_seg='NSE', triggerprice=0):
    try:
        orderparams = {
            "variety": variety,
            "tradingsymbol": symbol,
            "symboltoken": token,
            "transactiontype": buy_sell,
            "exchange": exch_seg,
            "ordertype": ordertype,
            "producttype": "INTRADAY",
            "duration": "DAY",
            "price": price,
            "squareoff": "0",
            "stoploss": "0",
            "quantity": qty,
            "triggerprice": triggerprice
        }
        orderId = costantine.SMART_API_OBJ.placeOrder(orderparams)
        print(f"The instrument {symbol} order id is: {orderId}")
    except Exception as e:
        print(f'instrument {symbol} Order placement failed:  {e}')

我可以获取的所有可用数据如下text

我尝试过以下调用

place_orderX('ROBO', instrument, symboltoken, 1, "BUY", "LIMIT", 'BO', ltp, slDelta, targetDelta, slDelta)

BO订单被拒绝,原因如下错误 - "BO is not allowed for this stock. Kindly place an order with a different product type."
我卡在这里

英文:

I have following method -

def place_order(token,symbol,qty,buy_sell,ordertype,price,variety= 'NORMAL',exch_seg='NSE',triggerprice=0):
    try:
        orderparams = {
            "variety": variety,
            "tradingsymbol": symbol,
            "symboltoken": token,
            "transactiontype": buy_sell,
            "exchange": exch_seg,
            "ordertype": ordertype,
            "producttype": "INTRADAY",
            "duration": "DAY",
            "price": price,
            "squareoff": "0",
            "stoploss": "0",
            "quantity": qty,
            "triggerprice":triggerprice
            }
        orderId = costantine.SMART_API_OBJ.placeOrder(orderparams)
        print(f"The instrument {symbol} order id is: {orderId}")
    except Exception as e:
        print(f'instrument {symbol} Order placement failed:  {e}')

All available data I can gather is from below
text

I had tried following call

place_orderX('ROBO', instrument, symboltoken, 1 , "BUY", "LIMIT", 'BO', ltp, slDelta, targetDelta,slDelta)

BO order is rejected due to below error -
"BO is not allowed for this stock. Kindly place an order with a different product type."
I am stuck here

答案1

得分: 0

API调用实际上是在下BO订单,上面的代码实际上运行良好。

但主要问题是某些符号不支持BO订单,下订单时需要小心交易的符号。只有对于这些符号,BO订单才会因以下错误而被拒绝 - "不允许为此股票下BO订单。请使用不同的产品类型下单。"

我正在搜索一个包含BO订单兼容符号的列表,但到目前为止还没有找到。

英文:

The API call actually placing the BO order , above code is actually working fine .

But main issue is that some symbol does not support BO order and while placing the order need to careful about the symbol to trade. Only for those symbols BO order will be rejected due to below error - "BO is not allowed for this stock. Kindly place an order with a different product type."

I am searching for a list which consists of BO order compatible symbols but not able to find till now.

huangapple
  • 本文由 发表于 2023年8月4日 04:31:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/76831444.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定