In addition to the use of order_target_percent() that Blue suggested, the other issue is that your sell order is for -100% instead of 0%, which causes you to go short. Unless I'm misinterpreting things, I'm assuming that you are only intending to take long positions on JNUG. Attached is my correction.
As far as the original post in this thread, the algorithm has promise, but needs some tweaks. The biggest issue is that it starts way too early. If you're using 200/30 EMA crossover, and begin trading at 9:40, over 90% of the data being used is from the previous day, which is no good. It seems like often, JNUG might open at 5% up, but then decline over the first hour. As far as this algorithm is concerned, the short MA is higher than the long MA, so it buys as the price is declining. If you move the start time to an hour, the returns go up to 400%, and the drawdown is reduced by 5-6%. The second issue is the condition for low volatility is too conservative. It misses a lot of good buying opportunities because of breakouts during a period that was considered low volatility at the beginning of the day. Personally, I set support and resistance levels before trading start, and do not allow the algorithm to enter a position if the price is between support and resistance.
I used this algorithm to learn Python and Quantopian, and am live trading one that is inspired by it, but bears little resemblance to it now, though the basic premise is the same. Since starting in June, I've had a couple of really good days (5-10%+ returns), one awful day (lost 7% because of a poorly thought out change), but otherwise not much of anything, as volatility has been relatively low in this timeframe. The good news is that JNUG and JDST are so liquid that I end up getting better results in live trading than I do in backtesting (I backtest every day and compare to the actual results), even with 0% slippage.