Back

IB account and multiple algorithms

Is it possible to simulataneously run several algorithms though a single Interactive Brokers account, or is a separate account required for each algorithm? Same question about other brokers suported by QuantConnect.

Update Backtest








Hi Tim,

No, it is not possible.
Quoting Jared Broad's answer on this discussion:

"If two algorithms were operating on a portfolio/cashbook at the same time it would be very difficult to make decisions and maintain state across both portfolios. Because of this we only allow 1 algorithm per brokerage. Additionally, Interactive Brokers only allows one computer to use a login at one time (you can't even login to TWS while QC is trading...)

We currently charge $10 for each additional VPS. You can use these for paper trading or trading on another brokerage. 

You could trade on two brokerages (or have 2 separate accounts at 1 brokerage) to solve this problem."

Alternately you can combine all your algorithms into a single one, for example:

private void OnData(TradeBars data)
{
CallTrendFollowingStrategy(data);
CallMeanReversionStrategy(data);
CallPairsTradingStrategy(data);
}

// Logic from your Trend Following Algorithm:
private void CallTrendFollowingStrategy(TradeBars bars)
{
foreach(var bar in bars)
{
// Your trend following logic here
}
}

// Logic from your Reversion Algorithm:
private void CallMeanReversionStrategy(TradeBars bars)
{
foreach(var bar in bars)
{
// Your mean reversion logic here
}
}

// Logic from your Pairs Trading Algorithm:
private void CallPairsTradingStrategy(TradeBars bars)
{
// Your pairs trading logic here
}

 

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.


Hi Alexandre,

Can you give an example of running different algos in one single algo using Python?

Thanks!!!

0

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