Back to Community
Momentum Trading Extremely Volatile

Hi,

I'm new to trading and I'm trying to create some very basic algorithms using my intuition. I've tried to code a basic momentum trading algorithm but it seems to be too volatile and gives obviously unrealistically high returns. Can anyone suggest what might be the reason?

Clone Algorithm
13
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: 55f9cfc89567ca0e0c1ad221
There was a runtime error.
1 response

unrealistic leverage - at one point up to 863 ... re-run by adding code below in handle_date and you will see how high the leverage is:
record (leverage=context.account.leverage)

take a look at https://www.quantopian.com/posts/quantopian-open-example-algorithm-to-control-leverage#55ed46fa50071cee15000218