Back

Alpaca partial fill interpreted incorrectly by LEAN engine

During Alpaca live paper trading I received the following messages:

2019-09-10 13:41:59 New Order Event: Time: 9/10/2019 1:41:59 PM OrderID: 2 Symbol: ERIE Status: PartiallyFilled Quantity: 17 FillPrice: 210.84 USD Message: Alpaca Fill Event
2019-09-10 13:41:59 New Order Event: Time: 9/10/2019 1:41:59 PM OrderID: 2 Symbol: ERIE Status: Filled Quantity: 23 FillPrice: 210.84 USD Message: Alpaca Fill Event
2019-09-10 13:42:00 New Order Event: Time: 9/10/2019 1:42:00 PM OrderID: 4 Symbol: ERIE Status: Invalid Message: Error placing order: insufficient qty (23 < 40)
 

My interpretation: LEAN engine assumes that I own 40 shares, and my algo is trying to sell them.

Alpaca knows that I own 23 shares, and rejects the sell order.

It looks like LEAN engine interprets Alpaca partial fills incorrectly.

Update Backtest







0

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.


Update Backtest





0

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.


Loading...

This discussion is closed