Back to Community
Squeeze Momentum with Q500us universe

Hey guys,
I have some trouble with building the code correctly. With just one stock it is running by using the talib library, but when I tried to implement it with Pipeline to dynamically choose stocks it didn't run and give me some error messages I don't understand actually. I am a newbie with quantopian and so far didn't have an intuition how to use pipeline right. With this code I want to choose stocks where the BollingerBands are within the KeltnerChannel so that they might brake out because they are squeezed. As an additional momentum indicator I choose a ADX above 25 and to determine the direction of the trade I used a comparison of the absolut value of the Directional Indicators (go long if |DI+| > |DI-| and vice versa for short). This is for an project at university and our task was to combine 2 indicators while using pipeline to create your portfolio. The source code is attached so you can have a look at it. It would be great if you maybe have some ideas how to fix the code so that it is working. Thanks in advance.

Regards,
Florian

Clone Algorithm
12
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: 5a27decfb08bac44c00adcf4
There was a runtime error.