here is my code:
And here is the results.
My problem is, this is place to Bid. When sell we place to Bid? But result price(=Bid)==13.92 and Bid is 13.92. This order should be execute but return is ERROR 4107.
Do some one help me what is a wrong in my code.
The error message say ERROR 4107-invarid price but my debug printing show the correct price. I am not see the wrong. Or this may to be use NormalizePrice(Bid)?
Your log says "invalid takeprofit for OrderSend function".
As noted by Petr, a invalid price doesn't necessarily mean "Open price".
I revise code as follows, and error still there! chaiya
Your problem is in your TP. Look at your log in your firs post. You try to set NEGATIVE TP:
ORDER_TYPE_SELL, Price=14.270,..., TP=-15.730 => Invalid takeprofit
You should set TP to e.g. 12.270
YES, THANK YOU TO THE POINT..