My strategy fails to send orders through in some rare cases. Although I have the strategy print the order size it's about to deal with, it sometimes somehow mistakes it.
What happens is:
-> My variable OrderSize (as integer) is calculated and printed, e.g. "order size = 1".
-> the strategy attempts to send an order via ExitLong(OrderSize).
In 95% of cases, it all goes through smoothly. But I occasionally get the "Order quantity has to be greater than 0" error (and my strategy therefore terminated), although in the print line above it correctly states the OrderSize it's about to deal with as 1.
Any suggestions?
Thanks,
noincome

Comment