Back to Community
Momentum Strategy Need Help

Hello everyone,

I am new to Quantopian,and am need of a little bit of help. I am trying to create an algorithm that day trades stocks based on momentum. I have an equation that finds the difference between the current price and the price 12 minutes ago. It is my understanding that I can't use this factor in pipeline because pipeline is only called once a day. I want my algorithm to go long when the momentum value is .15 or greater, and sell the stock when the value drops below 0. I was able to create the momentum equation, but I am having trouble taking that value and using it to buy and sell stocks. Please Help.

Clone Algorithm
2
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: 58892693d24d384875f5cf48
There was a runtime error.
2 responses

I think this is what you are trying to do....

Clone Algorithm
14
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: 58893ede778aea62cea732c0
There was a runtime error.

Yeah that's perfect thanks I had no idea the problem was so easy.