Back to Community
Problems executing correct amount of orders perday.

Hi, i'm trying to make some fundamental stuff for an algorithm trading oil futures. The algorithm should only be allowed to either long or short one share per day. However the current algorithm trades anything from 1-6, and i can't quite figure out why. I have attached a backtest of the algorithm.

Clone Algorithm
0
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: 592864193cc94c6a13435849
There was a runtime error.
1 response

The code is a bit complex for those not familiar with it. I did not notice anything obvious.

I recommend using the debugger to watch the variables change. If you can see it in slow motion, you might be able to fix the behavior.
https://www.quantopian.com/posts/new-feature-debugging-in-the-ide