Skip to content

Releases: alpacahq/alpaca-trade-api-js

Add support for Portfolio History endpoint

02 Mar 06:00
Compare
Choose a tag to compare

Documentation for this endpoint is forthcoming on the Alpaca site, but you will be able to use it to access the same data that is used to make the performance chart on the Alpaca dashboard. You can access the new method with Alpaca.prototype.getPortfolioHistory, like so:

getPortfolioHistory({
  date_start: Date,
  date_end: Date,
  period: '1M' | '3M' | '6M' | '1A' | 'all' | 'intraday',
  timeframe: '1Min' | '5Min' | '15Min' | '1H' | '1D',
  extended_hours: Boolean
}) => Promise<PortfolioHistory>

Add Bracket Order Support

06 Feb 06:57
f7b09d9
Compare
Choose a tag to compare

This release adds support for bracket orders. You can submit a bracket order like so:

{
  "side": "buy",
  "symbol": "SPY",
  "type": "market",
  "qty": "100",
  "time_in_force": "gtc",
  "class": "bracket",
  "take_profit": {
    "limit_price": "301"
  },
  "stop_loss": {
    "stop_price": "299",
    "limit_price": "298.5"
  }
}

Please note the inclusion of the new nested parameter in the order list call. Specifying nested=true will make it so that bracket orders have legs fields which will contain their child orders. Child orders will be in this nested field rather than the main array of orders. For more information about using bracket orders at Alpaca, please refer to https://docs.alpaca.markets.

Add Polygon v2 data endpoints

03 Dec 17:00
bdb2897
Compare
Choose a tag to compare

In this release, support has been added for the following Polygon endpoints:

Historic Trades v2: https://polygon.io/docs/#!/Stocks--Equities/get_v2_ticks_stocks_trades_ticker_date
Historic Quotes v2: https://polygon.io/docs/#!/Stocks--Equities/get_v2_ticks_stocks_nbbo_ticker_date

The methods using the v1 endpoints have been marked as deprecated and will be removed from the library in a future release, as Polygon intends to remove them from the API.