Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    Issue fetching Historical data

    Python SDK
    0
    12
    180
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      Vypy1 @Vypy1 last edited by

      @Vypy1 @admin any update on this?

      V 6 Replies Last reply Reply Quote 0
      • V
        Vypy1 @Vypy1 last edited by

        @Vypy1 I did some digging and it seems the request itself is not receiving the correct data.

        I used the below code to check if your _request function is receiving the right data, but there seems to be some problem here.

        My date requested from is 2019-1-1 and I start getting data from 2020-1-1

        params = historicParam = {
                    "exchange": "NSE",
                    "symboltoken": 11821,
                    "interval": 'ONE_DAY',
                    "fromdate": '2019-01-01 09:15',
                    "todate": '2022-11-17 15:30'
                }
        route = 'api.candle.data'
        method = 'POST'
        
        print(obj._request(route=route, method=method, parameters=params)['data'])
        
        [['2020-11-10T00:00:00+05:30', 104.5, 105.4, 101.15, 101.8, 662663], ['2020-11-11T00:00:00+05:30', 102.55, 103.0, 100.5, 101.85, 653453], ['2020-11-12T00:00:00+05:30', 101.9, 103.2, 101.0, 102.0, 594231], ['2020-11-13T00:00:00+05:30', 102.0, 103.9, 100.0, 101.45, 1197144], ['2020-11-17T00:00:00+05:30', 102.2, 110.85, 101.5, 107.0, 2480276], ['2020-11-18T00:00:00+05:30', 107.0, 110.9, 106.75, 109.45, 2004444], ['2020-11-19T00:00:00+05:30', 109.0, 112.0, 105.7, 107.9, 1102268], ['2020-11-20T00:00:00+05:30', 108.75, 114.0, 108.2, 112.7, 2950348], ['2020-11-23T00:00:00+05:30', 113.8, 113.8, 111.1, 111.6, 1840552], ['2020-11-24T00:00:00+05:30', 111.95, 113.6, 111.0, 111.4, 2382269], ['2020-11-25T00:00:00+05:30', 112.25, 116.0, 111.3, 115.2, 3936048], ['2020-11-26T00:00:00+05:30', 116.05, 118.0, 114.05, 115.65, 1452319], ['2020-11-27T00:00:00+05:30', 116.0, 120.0, 114.95, 118.1, 2300417], ['2020-12-01T00:00:00+05:30', 118.2, 127.35, 116.55, 125.65, 3557627]
        
        1 Reply Last reply Reply Quote 0
        • V
          Vypy1 @Vypy1 last edited by

          @Vypy1 @admin any update here?

          V 1 Reply Last reply Reply Quote 0
          • V
            Vypy1 @Vypy1 last edited by

            @Vypy1 @admin why is there no response on this? You make the API, if your users have a question its better to respond to them than be completely silent about it.

            1 Reply Last reply Reply Quote 0
            • V
              Vypy1 @Vypy1 last edited by

              @Vypy1 @admin what is the update on this?

              1 Reply Last reply Reply Quote 0
              • V
                Vypy1 @Vypy1 last edited by

                @Vypy1 @admin waiting for your response

                1 Reply Last reply Reply Quote 0
                • V
                  Vypy1 @Vypy1 last edited by

                  @Vypy1 @admin I have been following up for a response on this and you guys don't care to even respond. What is the issue?

                  1 Reply Last reply Reply Quote 0
                  • V
                    Vypy1 @Vypy1 last edited by

                    @Vypy1 @admin what's the update here?

                    1 Reply Last reply Reply Quote 0
                    • V
                      Vypy1 last edited by

                      @admin what's the update on this?

                      1 Reply Last reply Reply Quote 0
                      • A
                        admin @Vypy1 last edited by

                        Hi @Vypy1

                        Historical data API is only able to fetch 500 records at a time.

                        Meaning if you are trying to fetch the data using below parameters it will fetch data from 13th Oct 2020 to 18th Oct 2022. Because the Gap between fromdate and todate is > 500 days, it is designed to return latest 500 values as follows = todate-500 days.

                        {
                        "exchange":"NSE",
                        "symboltoken":"11821",
                        "interval":"ONE_DAY",
                        "fromdate":"2020-08-09 11:00",
                        "todate":"2022-10-18 11:40"
                        }

                        Hope this helps to clarify.

                        V 1 Reply Last reply Reply Quote 1
                        • V
                          Vypy1 @admin last edited by

                          @admin Thanks admin, I tried this and it works, however earlier I could fetch 2000 records for daily candles. Even this page says I can fetch 2000 days for 1 Day candles

                          https://smartapi.angelbroking.com/docs/Historical

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post