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

Fix polygon get historical prices #673

Merged
merged 21 commits into from
Jan 18, 2025
Merged

Conversation

brettelliot
Copy link
Collaborator

@brettelliot brettelliot commented Jan 2, 2025

Description by Korbit AI

What change is being made?

Remove redundant warning in drift rebalancer, enhance handling of short positions, update loop limits for holiday adjustments in data fetchers, fix handling of timeshift in Yahoo data, re-enable missing dates logic in polygon helper, and align tests with updated configuration approach.

Why are these changes being made?

The removed warning was redundant as it doesn't impact rebalance logic significantly and clutters the logs. Short position handling is improved to correctly manage covering scenarios during rebalancing. Adjustments in loop limits and timeshift address better accommodation for market holidays, ensuring enough data is fetched. Reinstating the missing dates logic ensures accuracy even with potentially incomplete data due to infrequent trading. Tests and API configurations are updated for better maintainability and ensure readiness for real-world scenarios, particularly concerning API key management.

Is this description stale? Ask me to generate a new description by commenting /korbit-generate-pr-description

@brettelliot brettelliot requested a review from grzesir as a code owner January 2, 2025 11:12
Copy link
Contributor

korbit-ai bot commented Jan 2, 2025

Korbit doesn't automatically review large (500+ lines changed) pull requests such as this one. If you want me to review anyway, use /korbit-review.

@brettelliot
Copy link
Collaborator Author

Updated summary of these changes

DriftRebalancer:

  • removed an uneeded warngin
  • fixed a bug in the logic so that now it correctly covers shorts when rebalancing.

AlpacaData / Pandas Data

  • now both use the same logic for getting extra days in order to provide the right number of bars. Before I was multiplying the length by 1.5. Now im doing what @bigredengineer. said to do which is calculate the number of weeks and add a small padding for 3 day weekends.

yahoodata:

  • fixed a simple bug where timeshift was not always a timedelta object.

test_example_strategies / test_polygon

  • added checks to skip certain tests without paid polygon subscriptions

test_gest_historical_prices

  • most of my time was spent here. i made specific tests to check a variety of things. these tests helped prove certain things were working.

@grzesir grzesir merged commit dc50f99 into dev Jan 18, 2025
2 checks passed
@brettelliot brettelliot deleted the fix-polygon-get-historical-prices branch January 22, 2025 02:06
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

Successfully merging this pull request may close these issues.

3 participants