Could anyone help me out with this issue? I'm trying to write a simple sector rotation algorithm based on momentum, but there are some issues I'm running into with how ordering is implemented. When I'm running a backtest with $100,000, sometimes I get positions with over $3,000,000 invested.