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

Open
wants to merge 21 commits into
base: dev
Choose a base branch
from

Conversation

brettelliot
Copy link
Collaborator

@brettelliot brettelliot commented Jan 2, 2025

Description by Korbit AI

What change is being made?

Refactor and enhance functionality for calculating and handling historical prices, managing various data source configurations, and ensuring proper order of execution during drift rebalancing.

Why are these changes being made?

The changes address issues with covered short positions, improve handling of historical prices and trading day calculations, and optimize test coverage. This refactor allows for better flexibility and accuracy in data handling, especially over long weekends, and ensures proper validations and usage of API keys with more robust configuration 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.

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.

2 participants