I am trying to test the position management module of my EA.
My code looks like this (which is basically the same as the demo in the donwload package):
Code: Select all
Print("+++ positions START");
// create a snapshot of current non zero positions (resolution down to (sub-) account)
int total_objects=0;
long serverPos=get_position(__conid);
total_objects=ibgCREATE_POSITION_SNAPSHOT(__conid);
debugPrint(StringFormat("no. of positions=%f, pos value:%d",total_objects,serverPos),INFO);
// list all positions by index
string dt;
for(int idx=0;idx < total_objects;++idx)
{
// print out a string fingerprint of positions (12 is id of position fingerprint;4 id of signed position;5 id of avg. entry price)
dt=ibgPOSITION_INFO_INT(idx,tcpi_dt_last_update);
PrintFormat("Position Info: dt:%d",dt);
// to get double values returned use function <ibgPOSITION_INFO_DBL>
}
Print("--- positions END");
Code: Select all
+++ positions START
INFO no. of positions=-1.000000, pos value:-100000
--- positions END
I did a test, the error code after the ibgCREATE_POSITION_SNAPSHOT(__conid) is 5039 or 5040:
5039: Amount of parameters more than the format specifiers
5040: Damaged parameter of string type
is there anything wrong with the plugin here? any update on either ibPlugin side or IB side I need to perform?
The version of my IB is: Build 981, Jan 11, 2021
The last modified date of my ibplugin.dll is: 30 Dec, 2020