Skip to content

Upgrades bars api endpoint to use v2#30

Open
mwlang wants to merge 1 commit intoccjr:masterfrom
mwlang:upgrade-bars-to-v2
Open

Upgrades bars api endpoint to use v2#30
mwlang wants to merge 1 commit intoccjr:masterfrom
mwlang:upgrade-bars-to-v2

Conversation

@mwlang
Copy link

@mwlang mwlang commented Dec 2, 2023

This is my first time using this gem and as I started using it, discovered bars endpoint was still on v1, which no longer exists.

There seems to be a lot of forward changes on the Alpaca endpoint since the bars endpoint was originally written, so this is a bit of a breaking change as well by introducing keyword arguments for all params.

Notes:

  • Alpaca::Trade::Api::Bar now has :trades and :weighted_average_price properties.
  • timestamps now return as strings and not ordinal on time, so Time.at changed to Time.parse on the Bar class.
  • timeframe method argument now a keyword argument (breaking change). Now optional and defaults to '1D'
  • symbols method argument now keyword argument (breaking change). Can accept a string for single symbol lookup.
  • asof optional parameter needed if desiring to look up FB or META correctly (see API docs). Defers to API when omitted.
  • feed optional parameter to modify source of data feed for the symbols. Defaults to 'sip'
  • start_date optional parameter to set the starting date for historical feed. Defers to API when omitted.
  • end_date optional parameter to set the ending date for historical feed. Defers to API when omitted.
  • Rspec can now be run with focus: true when focusing on specific specs.

There are some pre-existing failing specs unrelated to changes to bars which I did not address.

@web2boomer
Copy link

I'm using this fork for my own project (and will add/fix anything beyond the work you've done), just wanted to say thanks and respect.

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