Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs
    1. Home
    2. rohit4417k
    R
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    rohit4417k

    @rohit4417k

    1
    Reputation
    8
    Posts
    1
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    rohit4417k Follow

    Best posts made by rohit4417k

    This user hasn't posted anything yet.

    Latest posts made by rohit4417k

    • Inconsistent Data using Websocket

      Hi @Moderator_2 , @Moderator_3 , @admin

      I am using websocket to log the price of two symbols. The connection has been alive since 3 hours, for the first 2 hours the data was consistent (price on angle one app and price fetched through websocket were same) , but after 12 pm, the price fetched using websocket is not even close to price shown by angel one api.
      Websocket Data - https://drive.google.com/file/d/1AtVCjwaK-ENAmSRZkRX6KAhh6YgHAkbv/view?usp=sharing
      Angel One App Data - https://drive.google.com/file/d/1TGGRRGIlArtBaufI1kqylD1yE8GsJr_u/view?usp=sharing

      Time: 12:34:24 -> BANKNIFTY03JUL2453000CE : 201.4 (websocket) , 183.95( Angel One app)
      This is happening after 12pm today, and is still happening as of this moment.
      I am only fetching the result and logging it in the on_data function of websocketv2.

      posted in General Discussion
      R
      rohit4417k
    • RE: How to modify order from Market Type in order to apply Stoploss

      @Moderator_3 Alright, Thanks a lot

      posted in General Discussion
      R
      rohit4417k
    • RE: How to modify order from Market Type in order to apply Stoploss

      @Moderator_3 The table on documentation page says stoploss and triggerprice is only valid for BRACKET ORDER.
      I want to know if we have functionality to mention stoploss and triggerprice on normal market order or not? As it is supported on AngelOne app?

      posted in General Discussion
      R
      rohit4417k
    • How to modify order from Market Type in order to apply Stoploss

      Hi @Moderator_3 , @Moderator_2 , @admin ,

      Suppose I am placing a order with variety : NORMAL and ordertype: MARKET , in order to place the order at the current price. Now, after some time I apply stoploss to this order using AngelOne app with help of exit button and applying stoploss and triggerprice.
      But I want to apply stoploss and triggerprice using smartapi. And I am not sure what should be the body of the request that I sent to the modifyOrder endpoint.
      Like : {
      "variety":"NORMAL",
      "orderid":"201020000000080",
      "ordertype":"STOPLOSS",
      "producttype":"INTRADAY",
      "duration":"DAY",
      "price":"0",
      "quantity":"1",
      "tradingsymbol":"SBIN-EQ",
      "symboltoken":"3045",
      "exchange":"NFO",
      "stoploss" : "210.00"
      }
      Will this work??
      Basically I am not sure what should be the ordertype, and whether we should keep price as 0 or price as stoploss value, and keep stoploss to be 0 ??

      posted in General Discussion
      R
      rohit4417k
    • RE: Websocket Connection automatically closes after placing a order

      @projectSB Hey, Thanks mate. I suspected the same issue. Thanks for the reply.

      posted in Python SDK
      R
      rohit4417k
    • Websocket Connection automatically closes after placing a order

      Hi @Moderator_1 , @Moderator_2 , @Moderator_3

      I am using Websocket to get the live feed. Now, upon reaching a specific LTP, I am placing a order. But after it, the websocket is getting automatically closed.
      Here is a part of my logic inside on_data() method:

      symbol1 = "BANKNIFTY26JUN24"+str(strikePrice)+"CE"
      symbol2 = "BANKNIFTY26JUN24"+str(strikePrice)+"PE"
      orderParam1 = {
      "variety": "NORMAL",
      "tradingsymbol": symbol1,
      "symboltoken": str(name_to_token[symbol1]),
      "transactiontype": "SELL",
      "exchange": "NFO",
      "ordertype": "MARKET",
      "producttype": "CARRYFORWARD",
      "duration": "DAY",
      "price": "0",
      "squareoff": "0",
      "stoploss": "0",
      "quantity": "15"
      }
      orderParam2 = {
      "variety": "NORMAL",
      "tradingsymbol": symbol2,
      "symboltoken": str(name_to_token[symbol2]),
      "transactiontype": "SELL",
      "exchange": "NFO",
      "ordertype": "MARKET",
      "producttype": "CARRYFORWARD",
      "duration": "DAY",
      "price": "0",
      "squareoff": "0",
      "stoploss": "0",
      "quantity": "15"
      }
      orderCE = smartApi.placeOrder(orderParam1)
      orderPE = smartApi.placeOrder(orderParam2)
      orderPriceCE = currCE
      orderPricePE = currPE
      orderSymbolCE = symbol1
      orderSymbolPE = symbol2
      logger.info(orderCE)
      logger.info(orderPE)

      Here is part of log file: -

      I 240626 13:58:30 index:247] Ticks: {'subscription_mode': 1, 'exchange_type': 2, 'token': '59624', 'sequence_number': 43031516, 'exchange_timestamp': 1719390510000, 'last_traded_price': 14445, 'subscription_mode_val': 'LTP'}
      [I 240626 13:58:30 index:247] Ticks: {'subscription_mode': 1, 'exchange_type': 2, 'token': '59623', 'sequence_number': 43031943, 'exchange_timestamp': 1719390510000, 'last_traded_price': 2870, 'subscription_mode_val': 'LTP'}
      [I 240626 13:58:31 index:247] Ticks: {'subscription_mode': 1, 'exchange_type': 2, 'token': '63893', 'sequence_number': 43032659, 'exchange_timestamp': 1719390511000, 'last_traded_price': 7950, 'subscription_mode_val': 'LTP'}
      [I 240626 13:58:31 index:247] Ticks: {'subscription_mode': 1, 'exchange_type': 2, 'token': '63893', 'sequence_number': 43032992, 'exchange_timestamp': 1719390511000, 'last_traded_price': 8055, 'subscription_mode_val': 'LTP'}
      [I 240626 13:58:31 index:252] Prices Crossed! 52900:7975,8055
      [I 240626 13:58:32 index:291] 240626001102493
      [I 240626 13:58:32 index:292] 240626001102559
      [W 240626 13:58:32 smartWebSocketV2:319] Attempting to resubscribe/reconnect (Attempt 1)..

      After logging the orderID, the websocket immediately gets closed. I have tried multiple times, it happens only after the last statement of on_data() has been executed. Its like it closes automatically as if It has nothing do more.
      Kindly help me, I don't want it to get disconnected.

      posted in Python SDK
      R
      rohit4417k
    • RE: Order not booked due to order price exceeding circuit limit

      Hi @Moderator_3,
      The order was placed when I set the "price" : "0". Earlier the price was set at the current LTP.
      Still you can have a look.
      Order id: 240626000912964
      Client id: B454713

      posted in General Discussion
      R
      rohit4417k
    • Order not booked due to order price exceeding circuit limit

      Hi @Moderator_1 @Moderator_2 @Moderator_3 ,
      I was trying to place a order using the placeOrder method of python sdk. The method returned the booked orderId. But in the app, it showed order was not executed due to orderPrice exceeds circuit limit.
      Here is the params body :
      orderParam1 = {
      "variety": "NORMAL",
      "tradingsymbol": symbol1, //BANKNIFTY26JUN2452900CE
      "symboltoken": str(name_to_token[symbol1]),
      "transactiontype": "SELL",
      "exchange": "NFO",
      "ordertype": "MARKET",
      "producttype": "CARRYFORWARD",
      "duration": "DAY",
      "price": str(currCE),
      "squareoff": "0",
      "stoploss": "0",
      "quantity": "15"
      }
      What is the cause? Why cannot I place a order at current price??

      posted in General Discussion
      R
      rohit4417k