Issue with order placement

venkatsys
venkatsys edited July 2020 in .Net API client
Dear Team,
I am working Kite API via VBA code to execute my automation calls. When I placed the API call it will took more than 16 seconds to execute a call every time..Will you please provide me a solution. Today I initiated CALL (RI9637) @ 1:50:52 PM but the call executed @ 1:51:08 PM. Kindly do the needful.I am facing a very big problem for this delay.Please help.
strUrl = "https://api.kite.trade/orders/regular"
rest_url_arg = tradingsymbol=BANKNIFTY20JULFUT&transaction_type=BUY&quantity=25&exchange=NFO&order_type=MARKET&product=MIS&validity=DAY
With objRequest .Open "POST",
strUrl, blnAsync
setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
.setRequestHeader "x-kite-version", 3
.setRequestHeader
"Authorization", "token " + mapi_key + ":" + access_token
.Send (rest_url_arg)
endWith
Tagged:
  • sujith
    Can you run in debug mode and give us the complete stack trace?
    We will check and get back to you. Make sure to remove all app and client-specific tokens.
  • venkatsys
    venkatsys edited July 2020
    Dear Sujith,
    Thanks for your kind reply. I am not getting any error message else am getting a proper success message.{STATUS:SUCCESS,DATA:{ORDER_ID:200710002446622}}.

    Today I am facing one Scenario,

    I placed BUY call @ 22450 it is Executed but it fails to execute at this price. I placed SL @ 22400 but it fails to execute @this price because of this 16 seconds delay, It is executed @22350. more than 50points Loss per lots..Kindly help to solve this problem

    I am using a BroadBand connection @100Mbs internet connection. Help me..
  • venkatsys
    venkatsys edited July 2020
    Dear Sujith,

    I have tested in the POST man Client also the same 16 seconds delay when u hit a call.Kindly help me to solve this.. I am facing a very big problem...

    I have tried these but I could n't solve this issue. Please help me.


    1.png 40.7K
  • rakeshr
    @venkatsys
    Your form data format seems to be correct( even though exchange:NFO and Quantity:25(multiple of 25) .
    Can you check, if you are sending the correct Authorization header? No newline should be at the end of the "Authorization" header's
  • venkatsys
    venkatsys edited July 2020
    @rakeshr
    I am sending the correct data format only. I am getting the ORDER ID as a success message delaying of 16 seconds.Help me how to sort this problem.
  • sujith
    Are you saying you are getting order id after 16 seconds or the execution is taking 16 seconds?
    Is this at the opening or closing of the market?
  • venkatsys
    @Sujith,
    I am getting order id after 16 seconds.
  • rakeshr
    {STATUS:SUCCESS,DATA:{ORDER_ID:200710002446622}}.
    So, you mean you received the above order status response 16seconds after order placement?
    Have you added any delay at your end or maybe check for any race-condition happening at your end?
  • sujith
    Ideally, the server will timeout way earlier than this.
Sign In or Register to comment.