This problem has bothered me for a long time. Most of my strategies use my self-defined PosSizers.
I get above "Trades not included .." error frequently. Sometimes this is because the PosSizer returns a larger number of shares than it should be, but sometimes I feel really hard to understand.
For example, my position sizer return N shares, the trades happened with no problems. But if I return N/2 shares, the trade is not included because of above error. That's very strange, since N/2 shares obviously need less money.
In some cases, I have 100% cash, but trades are not executed successfully. That's also very strange.
Do you know how to track these kind of problems? Specifically, anyway to view these "not included" trades? I tried a lot and cannot think of more ideas.
Size:
Color:
Try Visual Studio debugger. Set a breakpoint in SizePosition(), step through the code, and quickly you'll see where you're making a mistake.
Size:
Color: