Negative UID but successful action when sending order
Posted: Tue Jan 19, 2021 3:39 pm
Hi,
It appears that the return value of order send function sometimes can be negative but successful.
Log reads:
Can this be another defect of the ibgORDER_SEND function?
I found this issue during my test, where I close my position twice and result in duplicate positions.
Debugging shows the code thinks the position close action failed and closed again where it actually succeeded and I can see two identical trades in IB.
It appears that the return value of order send function sometimes can be negative but successful.
Code: Select all
long uid= __ib.order_send(__conid_EURUSD
,orderType // defined in file include/trade-commander.com/ibplugin_types.mqh
,size
,0
,targetPrice
,0
,0
,IntegerToString(magicNumber)+","+IntegerToString(posOpen)+"C"
,0
,0);
PrintFormat("Position close signal sent, uid:%d, checking if position is closed already",uid);
You can see the return value is not in the error code list.Position close signal sent, uid:-721204922, checking if position is closed already
Can this be another defect of the ibgORDER_SEND function?
I found this issue during my test, where I close my position twice and result in duplicate positions.
Debugging shows the code thinks the position close action failed and closed again where it actually succeeded and I can see two identical trades in IB.