Open nathanhack opened 12 months ago
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.
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.
You're absolutely right, my mistake.
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.
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.
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?
@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.
Would it be possible to add the session open/close and settlement date to CalendarDay https://github.com/alpacahq/alpaca-trade-api-go/blob/efb7598b00a215d6ae06ca43b8592e7cbcb8e5c1/alpaca/entities.go#L177