Back

IBKR Lite/Fractional Shares

Does QuantConnect support fractional shares trading thru IBKR Lite broker? 

I have the following algo:

class Algo(QCAlgorithm):

def Initialize(self):
...
self.SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage)
self.DefaultOrderProperties.TimeInForce = TimeInForce.Day
self.spy = self.AddEquity('SPY', Resolution.Hour)
self.spy.FeeModel = ConstantFeeModel(0) // simulate IBKR Lite no commission policy

Trying to buy shares using this function where "shares" is of float type:

self.LimitOrder(self.spy.Symbol.Value, shares, self.spy.Price)

Getting this error:

Backtest Handled Error: Unable to submit order with id -10 which quantity (0.525403850711429) is less than lot size (1).
Warning: Due to brokerage limitations, orders will be rounded to the nearest lot size of 1

 

Is ther a way I can change my brokerage limitations during backtest to allow for fractional shares? Do fractional shares work during live trading? 

 

Thanks!

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.


I think this is a great feature as it can really better realize exact % allocations in strategies; looking forward to seeing replies! 

0

IBKR lite does not support API trading so is impossible to use on QuantConnect

2

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.


Hi Jared, thanks for following up! What about the backtesting/live trading fractional shares with an IBKR Pro account on the QuantConnect platform?

Looks like IBKR Pro supports fractional shares as well:
 

https://www.interactivebrokers.com/en/index.php?f=45718

 

0

Awesome I couldn't find that link =) Sounds good we can remove the 1-lot size for IB then. It is currently based on asset/symbol-properties, not brokerage so we'll need to do some reengineering to make it brokerage specific.

Our hands are pretty full the next couple of weeks but we can take a look at it in July. 

3

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