alpacahq / Alpaca-API

The Alpaca API is a developer interface for trading operations and market data reception through the Alpaca platform.
https://alpaca.markets/
141 stars 13 forks source link

All orders which specify asset_id are being rejected #184

Closed brian-from-quantrocket closed 3 years ago

brian-from-quantrocket commented 3 years ago

Describe the bug Per the docs, when placing an order (POST /v2/orders), the symbol field can be set to the ticker symbol or the asset_id. As of June 1, placing an order using the asset_id fails with an error message like:

could not find us_equity 'b0b6dd9d-8b9b-48a9-ba46-b9d54906e415' (error code 40010001)

This affects both live and paper accounts.

QuantRocket users are currently unable to place orders to Alpaca as a result of this issue because QuantRocket relies on asset IDs.

To Reproduce Steps to reproduce the behavior:

  1. Look up an asset_id using GET/v2/assets or GET/v2/assets/{symbol}. For example, the asset ID for AAPL is b0b6dd9d-8b9b-48a9-ba46-b9d54906e415
  2. Use the asset ID to place an order using POST /v2/orders

Expected behavior Placing orders using asset IDs has worked since Alpaca's launch and was working as recently as Friday, May 28 before the Memorial Day holiday.

Using asset_ids (which don't change) to place orders is a safer approach than using ticker symbols (which can change) because it avoids the risk of inadvertently placing an order for the wrong security in the event that a ticker symbol has become stale due to a ticker change.

raja commented 3 years ago

@brian-from-quantrocket Thanks for the detailed report. This is a regression we noticed as well. The fix will be out before market open tomorrow

SC4RECOIN commented 3 years ago

A fixed has been pushed out and should be in effect. Thank you for the report.