Regarding implementation of live strategy

anupama
Trades/decisions on 1 hour candle at usually taken after the candle is completed every hour.

However my strategy involves working on 1 hour candles at 15 min intervals.

That is, every 15 min the program should look at current 1 hr candle and trigger trade when condition is met at current price of 1 hour candle.

For example, the Hourly Candle starting at 10AM should be checked at 10.15, 10.30, 10.45 hours and trade taken when condition met at any of these times.

Can this be coded in Kite Connect?
  • shortwire
    Yes, it can be. Kite connect will just give you the ticks. You will need to create the 1 hour candles at your end. Or if you a have a historical data subscription, you could chose to get 15 minutes candles and build the 1 hour candle from those 15 minutes.
    Now when you build the first 15 minute candle (either via ticks or historical), this contributes to the first 15 minutes of the 1 hour candle too. So you 1 hour candle also looks the same at that point of time. When the next 15 minutes come - you will need to calculate what would the in-flight 1 hour candle look like by taking the open of the first 15 minute, highest of the two 15 minutes, lowest of the two 15 minutes and close of the last 15 minutes. That gives you the modified in-flight 1 hour candle created from two 15 minute candles. And this process can go on till the hour ends and fresh hour starts forming.
    So at end the ever 15 minutes, you in-flight 1 hour candle can be calculated and trade take on on the basis of that. If you need coding support professionally, you can inbox me.
  • sujith
    Kite Connect is just a set of REST-like APIs, you can place an order when the required conditions are met.
    For live strategies, you can generate candles at your end using the live market data provided via Websockets API.

    For more information check out FAQs here.
  • ramatius
    That is called a "pipelined" 1-hour candle with a pipeline interval of 15min. I guess this should be doable in an excel. Alternatively, you can look at implementing it as a custom algo under quantindia.in .
Sign In or Register to comment.