Error code 138 while trying to close less than the full lot amount

 

Howdy,


I am trying to accomplish a partial close of an order. After finding the order I use this to close some of it.


if (OrderClose(_t,0.01,Ask,5,CLR_NONE))tsNumRetries=0;


This is on an OP_SELL order. It shows the close in the "results" area of the back tester and it shows the proper amount closed. However, that order seems to disappear (the order# never takes a profit or gets stopped out). Plus, the journal shows an Error 138. I have tried the RefreshRates() and the error still shows.


I suspect this may be a problem with this procedure being tested. If anyone has some thoughts I would sure like to hear them. Thank You


Deane