Back to Community
Combination of BollingerBand (BB), Moving Average Convergence Divergence (MACD) and Relative Strength Index (RSI)

Hello Everyone,

I am not really a python expert, so there is definitely room for improvement there and also it needs a bit of clean up.

I have taken BB, MACD and RSI as indicators to buy and sell SPY.

The algorithm buys if BB, MACD or RSI thinks as it is a buy and shorts SPY, if it thinks its a sell.

I have a stop loss, if the evaluation of the portfolio falls below a certain amount. I think there is room for improvement in stop loss department.

I ran the algorithm in different time periods and it seems to outperform SPY. Can someone please take a look and see if there is a room for improvement or am i doing something wrong here ?


Clone Algorithm
Backtest from to with initial capital
Total Returns
Max Drawdown
Benchmark Returns
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: 55ff67ef09d8ea0e0f052640
There was a runtime error.
4 responses

Hi Amol,

Can you replicate this algo with long_only strategy?


no position control. when doing backtest you can see that the machine buy and sell far from max initial capital

Hi Amol.. I think this is leverage... and I dont see... and I dont see any... stoploss in place... it doesnt seem.. to add up... pls. check. thanks

Hi Amol,
I am new the Quantopian. I came across your post. I was thinking about developing similar Alogo but I have very entry level python skills and zero skills developing experience for Quantopian. Have you made any changes to your code to fix problems suggested by community members?