trading-ig
trading-ig copied to clipboard
Different return for fetch_historical_prices_by_epic_and_date_range()
Hi all!
Why is it that when I run the function 'fetch_historical_prices_by_epic_and_date_range()' I sometimes get a return that looks like this:
MultiIndex([( 'bid', 'Open'), ( 'bid', 'High'), ( 'bid', 'Low'), ( 'bid', 'Close'), ( 'ask', 'Open'), ( 'ask', 'High'), ( 'ask', 'Low'), ( 'ask', 'Close'), ('last', 'Open'), ('last', 'High'), ('last', 'Low'), ('last', 'Close'), ('last', 'Volume')], )
And sometimes like this:
MultiIndex([('bid', 'Open'), ('bid', 'High'), ('bid', 'Low'), ('bid', 'Close'), ('ask', 'Open'), ('ask', 'High'), ('ask', 'Low'), ('ask', 'Close')], )
I always call this function the same way in my code. It seems to be a random principle. What could be the reason for this?
This example doesn't provide Volume. I have tried version=1 and version=2. epic = 'IX.D.DAX.IFMM.IP' resolution = '30MIN' current_date_str = '2024-02-23T22:30:00' next_date_str = '2024-02-26T17:30:00' response = ig_service.fetch_historical_prices_by_epic_and_date_range(epic=epic, resolution=resolution, start_date=current_date_str, end_date=next_date_str, version='1')
But when i try the same request with https://labs.ig.com/sample-apps/api-companion/index.html, the response is correct.
Many thanks for any help :-)
Best regards Dominik