We're excited to share that we've shipped a complete integration with Alpaca! Alpaca is an API-driven, commission-free brokerage founded in 2015. Headquartered in California, Alpaca has quickly matured and expanded asset classes and offerings. 

Through the integration with QuantConnect, Alpaca clients can now easily algorithmically trade to three primary asset classes: US Equities, US Equity Options, and Cryptocurrency. Cash and margin accounts have been added, along with live trading through to paper or live accounts.

To configure your algorithm to use Alpaca fees and account types, set the brokerage model as shown below: 

# Alpaca Cash and Margin Account Models
self.set_brokerage_model(BrokerageName.ALPACA, AccountType.CASH)
self.set_brokerage_model(BrokerageName.ALPACA, AccountType.MARGIN)

We have implemented five order types, Market, Limit, Stop Market, Stop Limit, and Trailing Stops. For more information on the brokerage integration, see Alpaca Reality Models.

This integration was sponsored by Alpaca, enabling the QuantConnect team to open-source the plugin and commit to its maintenance for the next two years. As new order types and asset classes are added to Alpaca, QuantConnect will be able to expand the plugin's support. Additionally, the Alpaca integration has been rolled out to the LEAN CLI and Local Platform for on-premise trading. We’re grateful for the commercial partnerships like this that help drive the open-source community forward!

Happy Trading!

QuantConnect Team