Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different return for fetch_historical_prices_by_epic_and_date_range() #334

Open
breitdom opened this issue May 28, 2024 · 1 comment
Open

Comments

@breitdom
Copy link

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

@bug-or-feature
Copy link
Member

You haven't provided enough information for the issue to be reproduced, which is always the first step in fixing an issue. See this FAQ item for the list of required info:

https://trading-ig.readthedocs.io/en/latest/faq.html#what-if-i-have-a-problem

And please learn how to use Markdown syntax for formatting code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants