Sourav Basu Roy
 · Algo Trader with Python and Fyers API

problem of duplicate candles in historical Data API

My code was throwing this error, {ValueError}ValueError('cannot reindex on an axis with duplicate labels') and when i started to look into it, i found that Fyers is sending a duplicate candle of the last candle as shown below.

[1698796800, 131.25, 137, 129.5, 132, 51255],
[1698883200, 130.05, 133.8, 128.85, 129.85, 22181],
[1698969600, 132.5, 133.75, 128.4, 128.65, 30408],
[1698969600, 132.5, 133.75, 128.4, 128.65, 30408]]

API was called using the following parameters.

{'cont_flag': '1', 'date_format': '1', 'range_from': '2023-09-05', 'range_to': '2023-11-05', 'resolution': 'D', 'symbol': 'NSE:EMAMIPAP-EQ'}

This is problematic as we are not getting the correct number of candles for the specified range of dates.

Kindly rectify this as soon as possible.

9 replies