How to identify a partial candle in python?

algotrader29
Suppose an algorithm is based on the last 3 candles on the 3 minutes chart. How do we know that the final candle is formed completely or in progress? or shall we have to do the time synchronization on our part meaning querying on multiples of 3mins1Sec from market open 9:15am will get us the last as a partially formed candle and the previous candles as completely formed?
  • Vivek
    @algotrader29 It's not a good idea to rely on historical API and its very difficult to tell the cut off time since there are considerable delay in processing and sending the data from our end since we store millions and millions of candles in database and query it.

    If your algo can't afford delay around minute or two then its better to rely on WebSocket ticks data and construct candle yourself.
  • RP3436
    Vivek
    My question is somewhat similar. For my strategy I need minimum 300 candles of 1 minute . So as the day begins I will need data at least for previous day. So do I need to subscribe to historical API?

    And given my strategy remains same, shall I have to continue with this Add On?

    In your reply you say " It's not a good idea to rely on historical API ...." and "....its better to rely on WebSocket ticks data and construct candle yourself". How can one get historical information from WebSocket ticks ? Does this suggestion imply that for our requirement (where let's say delay can not be afforded) of historical candles we have to first collect live tick data and generate candles to be called as past candles ?

    Finally if need to use 200 period EMA on 1 minute chart , should I need to take candle API add on if 1 minute delay is acceptable?
    Kindly clarify.
  • sujith
    Hi,
    You need historical data subscription to access yesterday's candles.
    You can experiment for a month by subscribing to it. If it fits your use case then you can use it.
    If it doesn't fit your purpose then you can generate candles at your end using live marker data provided on websockets.
Sign In or Register to comment.