Does the Alpaca brokerage model include support for fractional shares?
The Alpaca documentation specifies that eligible securities that support fractional shares require a minimum of $1, and it cannot exceed 9 decimal places for the quantity or notional quantity.
Mia Alissi
Currently, the QuantConnect documentation and API references for the AlpacaBrokerageModel do not explicitly confirm support for fractional shares. However, the Alpaca platform itself does support fractional trading, subject to specific conditions and securities being eligible. Since Alpaca allows fractional trading, it is very likely that the AlpacaBrokerageModel in QuantConnect would accommodate this, as QuantConnect aims to mirror the brokerage's capabilities. For verification or implementation of fractional trades, you might consider consulting recent updates directly from QuantConnect's LEAN engine or community forums for the latest developments.
Sources: Alpaca - QuantConnect.com, Supported Models - QuantConnect.com, QuantConnect Paper Trading - QuantConnect.com
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Lemuel
Has anybody had success with the fractional shares via Alpaca brokerage so far?
Alexandre Catarino
Hi Lemuel,
Short answer: no, and it is not a limitation of the Alpaca integration specifically. Fractional equity shares are not supported on QuantConnect for any brokerage, in backtesting or in live trading.
The reason is where the minimum tradable unit is defined. LEAN reads it from the Symbol Properties database, and the entry that covers every US equity sets a lot size of 1 share:
Two things follow from that. An order for less than one share is rejected with OrderQuantityLessThanLotSize, and SetHoldings rounds the quantity it computes down to a whole number of shares. That second one is the usual surprise: a small account targeting an expensive stock can end up placing no order at all.
Crypto through Alpaca is different. Those assets are registered with their real minimum trade increment, so fractional quantities do work there.
This is tracked upstream in Lean issue #7282, Support for Fractional Equities. The fix is to let the brokerage model decide whether fractional orders are allowed, rather than the Symbol Properties database, since in practice it depends on the account and not on the asset. It is open, so there is nothing to enable on your side yet.
One correction while I am here: the automated reply earlier in this thread guessed that support was "very likely" present. That was not accurate, and I am sorry it stood unchallenged for so long.
Vipervin
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!