Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Expand timeframe options for getBars #88

Closed
jerrami opened this issue Jan 10, 2022 · 2 comments · Fixed by #89
Closed

Expand timeframe options for getBars #88

jerrami opened this issue Jan 10, 2022 · 2 comments · Fixed by #89
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@jerrami
Copy link
Contributor

jerrami commented Jan 10, 2022

First, thanks so much for putting this together and maintaining it. I'm a big fan & it's saved me a TON of time in doing a typescript integration with Alpaca APIs.

Is your feature request related to a problem? Please describe.
In using the getBars API, I noticed that you're missing a decent amount of documented and undocumented accepted timeframes. Currently, the timeframe accepts '1Sec' | '1Min' | '1Hour' | '1Day' options. After researching the Alpaca docs and some trial and error, there are a handful of other values that are acceptable.

Not all-inclusive, but some of the more common (maybe a better word is more useful) ones are :

  • '5Min'
  • '15Min'
  • '30Min'
  • '2Hour'
  • '4Hour'

At least the 15Min one is referenced at Alpaca bars v2. Additional testing (via Postman) has shown that you can seemingly input any number followed by 'Min' and get actual formatted responses back - e.g., '37Min' actually works and spaces the bars by 37 minutes.

Describe the solution you'd like
I would like the ability to input at least the listed above values (5min, 15min, etc.) as viable union type selections for the GetBars timeframe.

Describe alternatives you've considered
It is absolutely easily possible to add "as ..." for the timeframe options. But since timeframes that you support are not individually exported, it is not currently feasible to do timeframe: '5min' as TimeFrame for example, which would also suffice.

Additional context
Would greatly appreciate it if selectable timeframes included additional values or were implemented as an individual exported type that could be imported & extended. Again, thanks so much for the work on this as a whole!.

@jerrami jerrami added the enhancement New feature or request label Jan 10, 2022
@117
Copy link
Contributor

117 commented Jan 10, 2022

I agree it should be more extensible. If you submit a PR I'll review and merge it asap, otherwise I will get to this feature sometime this week and ping you. Thank you for the kind words 😃 I'm glad this library is of use to you.

@jerrami
Copy link
Contributor Author

jerrami commented Jan 10, 2022

I agree it should be more extensible. If you submit a PR I'll review and merge it asap, otherwise I will get to this feature sometime this week and ping you. Thank you for the kind words 😃 I'm glad this library is of use to you.

I'll gladly take the opportunity to provide a PR. Gimme a few days to balance work & family obligations. You can park this for now until I provide a PR 😃. At the least, I should be able to get to it later this week/weekend.

@117 117 added the good first issue Good for newcomers label Jan 11, 2022
@117 117 linked a pull request Jan 12, 2022 that will close this issue
@117 117 closed this as completed in #89 Jan 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants