Get LTP or quote of 100 stocks after every 10 minutes at the same time and analyse them.

dummydost
dummydost edited September 2016 in Python client
I want to know the current market price of 100 stocks after 10 minutes , so that I can analyze them generate buy/sell triggers based on some logic. Suppose 60 buy/sell triggers are generated and I want to execute these orders at the same time.
My questions are:
1) How do fetch LTP of 100 stocks after 10 minutes? What is the best way?
2) Is it possible to issue tens or even hundreds of buy/sell orders at the same time , like in my scenario? What is the best way, if it is possible? If not, is there a workaround or will you guys implement it in the near future?
  • Kailash
    1) Initialize a WebSocket connection, subscribe to those 100 instruments. You'll get data (including LTP) immediately after the subscription request is sent.

    2) We rate limit requests to 1/sec, so you can only send 1 order per second at most. This may change in the future.
  • dummydost
    dummydost edited September 2016
    @Kailash How do I do this:
    Buy 300 shares of RELIANCE at 9:46:00am
    Sell 500 shares of SBIN at 9:46:00am
    Sell 800 shares of INDIACEM at 9:46:00am
    Sell 1000 shares of WIPRO at 9:46:00am
    Buy 5000 shares of RCOM at 9:46:00am
    Buy 1000 shares of APOLLOTYRE at 9:46:00am

    Thanks!
  • Kailash
    1) Initiate a Connect login (just to be safe, at 9 AM before market opening), do the token exchange, obtain the access_token and set it in your application.

    2) Set cron jobs (or some sort of an in-program timer) to trigger your orders. Do note that we rate limit at 1 request / second, so you'll have to place your orders sequentially with at least a second difference between each request so as to not get rate limited.
  • dummydost
    dummydost edited September 2016
    @Kailash @vivek
    When will we have this feature : multiple orders execution in one go? Can you please tell me rough timeline?
    Will it be available by the end of this year?

    I really need it.
  • Kailash
    @dummydost We're trying to incorporate this feature in our upcoming major upgrade which we hope will be ready in 2-3 months.
  • Ramkrishna
    @Kailash do you mean if we send 1 buy/sell order, 1 stop loss order consecutively, you will honor only one request?
  • Vivek
    @Ramkrishna I would like to correct Kailash here that you can send upto 3 requests per second and above that you will get rate limiting error.
Sign In or Register to comment.