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

Additions to Calendar struct #266

Open
nathanhack opened this issue Dec 2, 2023 · 7 comments · May be fixed by #268
Open

Additions to Calendar struct #266

nathanhack opened this issue Dec 2, 2023 · 7 comments · May be fixed by #268
Assignees
Labels
enhancement New feature or request

Comments

@nathanhack
Copy link

Would it be possible to add the session open/close and settlement date to CalendarDay

type CalendarDay struct {

{
      "date": "1970-01-02",
      "open": "09:30",
      "close": "16:00",
      "session_open": "0400",
      "session_close": "2000",
      "settlement_date": "1970-01-06"
}
@gnvk
Copy link
Collaborator

gnvk commented Dec 4, 2023

These fields are not returned by the server. If you'd like to open a feature request for this, please use https://github.com/alpacahq/Alpaca-API/ instead.

@gnvk gnvk closed this as completed Dec 4, 2023
@nathanhack
Copy link
Author

Thanks for the quick response. I'm unable to verify the broker API endpoint you provided has the requested fields or not. However, the endpoint under trader API: https://docs.alpaca.markets/reference/getcalendar does have those fields. The json from above is from the trader api.

It's possible when I gave the perm link for the entity I provided the wrong entity, if so I'm sorry for the confusion.

@gnvk gnvk linked a pull request Dec 6, 2023 that will close this issue
@gnvk
Copy link
Collaborator

gnvk commented Dec 6, 2023

You're absolutely right, my mistake.

@gnvk gnvk reopened this Dec 6, 2023
@gnvk gnvk self-assigned this Dec 6, 2023
@gnvk gnvk added the enhancement New feature or request label Dec 6, 2023
@Neal
Copy link
Member

Neal commented Dec 6, 2023

Would it be possible to add the session open/close and settlement date to CalendarDay

@nathanhack What are you trying to use the session open/close values for? As to be honest, they were added to the calendar API response unintentionally (as you can tell by the different time format) and we've meant to mark them as deprecated in the docs so I would avoid adding them to the SDK.

@nathanhack
Copy link
Author

Yeah I had noticed the format difference, I assumed I would have to put in a API request to get that fixed.

As far as how I use it, I use it to limit the trades that I use for training.

I was using Polygon.io for those values but I was happy to see them here, so that I can remove a dependency.

@gnvk
Copy link
Collaborator

gnvk commented Jan 15, 2024

I think removing Polygon as a dependency sounds like a huge plus :D

@Neal What if you changed the time format to match the rest of the API and add it properly?

@Neal
Copy link
Member

Neal commented Jan 17, 2024

@gnvk unfortunately changing the format won't be possible as even though it's an undocumented field, many users could still be using it and can break their code.

so in this case, I am fine to add the fields to the struct and we can just document its purpose accordingly.

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

Successfully merging a pull request may close this issue.

3 participants