InputException: Difference between `to` and `from` dates for `minute` cannot be more than 30 days

naz
@sujith
why is below historical data command giving error message - " InputException: Difference between `to` and `from` dates for `minute` cannot be more than 30 days"

tick = kite.historical(instrument_token=256265, from_date='2018-01-28', to_date='2018-02-27', interval='minute')

Difference between '2018-01-28' and '2018-02-27' is not more than 30 days !
  • shortwire
    @naz The days difference between 28-Jan and 27-Feb is 31 days and this includes both the days. You have to count both the days and additional 31st day of Jan in your count. Here is the count:

    28/01/18 1
    29/01/18 2
    30/01/18 3
    31/01/18 4
    01/02/18 5
    02/02/18 6
    03/02/18 7
    04/02/18 8
    05/02/18 9
    06/02/18 10
    07/02/18 11
    08/02/18 12
    09/02/18 13
    10/02/18 14
    11/02/18 15
    12/02/18 16
    13/02/18 17
    14/02/18 18
    15/02/18 19
    16/02/18 20
    17/02/18 21
    18/02/18 22
    19/02/18 23
    20/02/18 24
    21/02/18 25
    22/02/18 26
    23/02/18 27
    24/02/18 28
    25/02/18 29
    26/02/18 30
    27/02/18 31
  • naz
    Thanks. I guess I missed out on counting the last date due to Pythonic list convention. This can be closed.
This discussion has been closed.