Error 130 (Invalid Stops) on Pending Order
Looks to be a rounding problem. When I pass the exact literal numbers, my trade works. However, if I calculate these numbers, I get a 130 error. The numbers print fine, but I assume that there is enough of a rounding error to cause the problem. Is there a way to round these floating point numbers? Any ideas?
I think I solved the problem with the NormalizeDouble function.
In my opinion You set stops too closely to price. (see MarketInfo(Symbol(),MODE_STOPS);)
I still have not figured out a pattern as to when it works and when it does not. But if anyone has seen this problem before can can share some insight, that would be much appreciated.
Thanks.