Back to Community
Arb with ETF and Underlying

I've been playing around with Quantopian for a while, but this is my first post to the forum. I've created an algorithm that trades on a given ETF and some underlyings. Here, I chose to use VGT (Vanguard Tech) and its 12 largest underlyings. The algo calculates the beta for each underlying relative to the ETF, and uses that along with the MACD as a trading signal.
The arb strategy is to short the etf and long the underlyings that are expected to outperform it based on the two trading signals.

Clone Algorithm
29
Loading...
Backtest from to with initial capital
Total Returns
--
Alpha
--
Beta
--
Sharpe
--
Sortino
--
Max Drawdown
--
Benchmark Returns
--
Volatility
--
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 5320ba9419e93306c40014e9
This backtest was created using an older version of the backtester. Please re-run this backtest to see results using the latest backtester. Learn more about the recent changes.
There was a runtime error.
1 response

You need to add some logic to manage your cash. You are using millions more than you actually have. Take a look at order_target_percent. I recommend modifying your code to take advantage of the alternative order methods.