"0" missing in timestamp at the start of new minute

dm_jadhav
Normal timestamp in tick data shows 6 values including seconds. but see below example to the timestamps i got at the start of minute
'timestamp': datetime.datetime(2018, 3, 23, 9, 16)
'last_trade_time': datetime.datetime(2018, 3, 23, 9, 16)
It does not show '0' seconds. Is it always like this or some setting is required to get 0 value at the end. Nonzero seconds are appearing properly.
Thanks
  • dm_jadhav
    can anybody please help on above. Thanks
  • Vivek
    Here is a response I got from ticker
    [{'timestamp': datetime.datetime(2018, 4, 4, 11, 35, 50), 'last_price': 271.1, 'oi_day_low': 0, 'volume': 14190057, 'sell_quantity': 2017446, 'last_quantity': 82, 'change': 0.38881688576190016, 'oi': 0, 'average_price': 269.85, 'ohlc': {'high': 273.3, 'close': 270.05, 'open': 267.25, 'low': 265.5}, 'tradable': True, 'depth': {'sell': [{'price': 271.2, 'orders': 5, 'quantity': 2800}, {'price': 271.25, 'orders': 8, 'quantity': 16030}, {'price': 271.3, 'orders': 12, 'quantity': 5258}, {'price': 271.35, 'orders': 9, 'quantity': 6113}, {'price': 271.4, 'orders': 28, 'quantity': 15369}], 'buy': [{'price': 271.1, 'orders': 18, 'quantity': 8932}, {'price': 271.05, 'orders': 18, 'quantity': 12492}, {'price': 271.0, 'orders': 72, 'quantity': 84617}, {'price': 270.95, 'orders': 12, 'quantity': 6123}, {'price': 270.9, 'orders': 27, 'quantity': 11212}]}, 'mode': 'full', 'last_trade_time': datetime.datetime(2018, 4, 4, 11, 35, 47), 'buy_quantity': 1971759, 'oi_day_high': 0, 'instrument_token': 1270529}]
    You can see that timestamp and last_trade_time has seconds also.
  • dm_jadhav
    Hi Vivek,
    Thanks for your response. But my query is about timestamp at the BEGINING of new minute. i.e at 60 second or 0 second. Please see below extract from one of the tick data I got. See the bolt text. value of second is missing. Is it always like this or some setting is required to get 0 value at the end?

    ': 100, 'average_price': 788.48, 'volume': 39524, 'buy_quantity': 102479, 'sell_quantity': 93717, 'ohlc': {'open': 788.0, 'high': 792.9, 'low': 785.3, 'close': 786.7}, 'change': 0.6737002669378358, 'last_trade_time': datetime.datetime(2018, 4, 6, 9, 18, 59), 'oi': 0, 'oi_day_high': 0, 'oi_day_low': 0, 'timestamp': datetime.datetime(2018, 4, 6, 9, 19), 'depth': {'buy': [{'quantity': 276, 'price': 792.15, 'orders': 3}, {'quantity': 10, 'price': 792.05, 'orders': 1}, {'quantity': 2391, 'price': 792.0, 'orders': 3}, {'quantity': 189, 'price': 791.95, 'orders': 1}, {'quantity': 209, 'price': 791.9, 'orders': 3}], 'sell': [{'quantity': 150, 'price': 792.55, 'orders': 1}, {'quantity': 123, 'price': 792.65, 'orders': 3}, {'quantity': 153, 'price': 792.7, 'orders': 1}, {'quantity': 124, 'price': 792.75, 'orders': 2}, {'quantity': 35, 'price': 792.8, 'orders': 1}]}}, {'tradable': True, 'mode': 'full', 'instrument_token': 315393, 'last_price': 1095.7, 'last_quantity': 47, 'average_price': 1096.59, 'volume': 19922, 'buy_quantity': 88005, 'sell_quantity': 87775, 'ohlc': {'open': 1092.0, 'high': 1102.5, 'low': 1092.0, 'close': 1094.25}, 'change': 0.13251085218186387, 'last_trade_time': datetime.datetime(2018, 4, 6, 9, 18, 58), 'oi': 0, 'oi_day_high': 0, 'oi_day_low': 0, 'timestamp': datetime.datetime(2018, 4, 6, 9, 19), 'depth': {'buy': [{'quantity': 67, 'price': 1095.1, 'orders': 2}, {'quantity': 254, 'price': 1095.05, 'orders': 2}, {'quantity': 190, 'price': 1095.0, 'orders': 4}, {'quantity': 25, 'price': 1094.25, 'orders': 1}, {'quantity': 182, 'price': 1094.2, 'orders': 2}], 'sell': [{'quantity': 20, 'price': 1095.7, 'orders': 1}, {'quantity': 110, 'price': 1095.85, 'orders': 2}, {'quantity': 610, 'price': 1095.9, 'orders': 2}, {'quantity': 50, 'price': 1096.0, 'orders': 1}, {'quantity': 122, 'price': 1096.05, 'orders': 1}]}}, {'tradable': True, 'mode': 'full', 'instrument_token': 2714625, 'last_price': 394.85, 'last_quantity': 14, 'average_price': 394.77, 'volume': 161684, 'buy_quantity': 302914, 'sell_quantity': 290613, 'ohlc': {'open': 394.2, 'high': 395.75, 'low': 392.85, 'close': 393.9}, 'change': 0.24117796395025273, 'last_trade_time': datetime.datetime(2018, 4, 6, 9, 18, 59), 'oi': 0, 'oi_day_high': 0, 'oi_day_low': 0, 'timestamp': datetime.datetime(2018, 4, 6, 9, 19),
  • Vivek
    Vivek edited April 2018
    Timestamp is a python datetime object and when you print dictionary it's formatted like this. You should ideally be accessting the timestamp object to get seconds.
This discussion has been closed.