Search found 29 matches

by hkenrique
Thu Jan 14, 2021 4:36 pm
Forum: IBPlugin
Topic: Managing multiple positions - is there a "comment" field in position?
Replies: 17
Views: 35792

Re: Managing multiple positions - is there a "comment" field in position?

Yes you can see my loop is able to retrieve the parent order id of the orders (490385839). but comment is void: CS 0 00:34:41.005 HFTLiteClassicIB (EURUSD,M1) CONNECTIONID: 1 MF 0 00:34:41.006 HFTLiteClassicIB (EURUSD,M1) Order Info: comment:, pid:490385839 NR 0 00:34:41.006 HFTLiteClassicIB (EURUSD...
by hkenrique
Thu Jan 14, 2021 4:21 pm
Forum: IBPlugin
Topic: Managing multiple positions - is there a "comment" field in position?
Replies: 17
Views: 35792

Re: Managing multiple positions - is there a "comment" field in position?

Hi, Yes I have done this but cannot retrieve the comment. full code: int orderNum=ibgCREATE_PENDING_ORDER_SNAPSHOT(IB_PLUGIN_DEF_CONNID,__conid,1); for(int i=0;i<orderNum;++i) { string comment=ibgORDER_INFO_STR(i,49); //comment of order unsigned long pid=ibgORDER_INFO_INT64(i,55); //pid of order Pri...
by hkenrique
Thu Jan 14, 2021 4:01 pm
Forum: IBPlugin
Topic: Managing multiple positions - is there a "comment" field in position?
Replies: 17
Views: 35792

Re: Managing multiple positions - is there a "comment" field in position?

Hi, Continuing our discussion about the comment field. So I sent an order with some comment but it seems I cannot get the comment with string comment=ibgORDER_INFO_STR(i,49); //comment of order long pid=ibgORDER_INFO_INT64(i,55); //pid of order PrintFormat("Order Info: comment:%s, pid:%d",comment,pi...
by hkenrique
Thu Jan 14, 2021 2:09 pm
Forum: IBPlugin
Topic: Managing multiple positions - is there a "comment" field in position?
Replies: 17
Views: 35792

Managing multiple positions - is there a "comment" field in position?

Hello, I am trying to manage multiple positions in IB, where ibgCREATE_POSITION_SNAPSHOT seems to present a nice realization. Now, I need to be able to differentiate the positions created by different strategies, they can be of the same symbol or different symbols. In MT5 I normally use magic number...
by hkenrique
Thu Jan 14, 2021 1:55 pm
Forum: IBPlugin
Topic: -1 return value of ibgCREATE_POSITION_SNAPSHOT in IB dem/live account
Replies: 2
Views: 12244

Re: -1 return value of ibgCREATE_POSITION_SNAPSHOT in IB dem/live account

Hello,

This does seem to work.
Thank you for helping out!
by hkenrique
Wed Jan 13, 2021 10:18 am
Forum: IBPlugin
Topic: -1 return value of ibgCREATE_POSITION_SNAPSHOT in IB dem/live account
Replies: 2
Views: 12244

-1 return value of ibgCREATE_POSITION_SNAPSHOT in IB dem/live account

Hello, 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): Print("+++ positions START"); // create a snapshot of current non zero positions (resolution down to (sub-) account) int total_objects=0; lon...
by hkenrique
Fri Aug 14, 2020 2:58 pm
Forum: IBPlugin
Topic: How do I manage my position like MQL5
Replies: 4
Views: 14615

Re: How do I manage my position like MQL5

Hello, Thank you for the reply. I guess this way to accurately monitor my position I will need to know the current filled order status. I see the document that there is a function to query the pending orders ibgORDER_PENDING_LIST(1,7,0); I wonder if there is function to list the filled orders (I the...
by hkenrique
Thu Aug 13, 2020 4:15 pm
Forum: IBPlugin
Topic: How do I manage my position like MQL5
Replies: 4
Views: 14615

How do I manage my position like MQL5

Hi, For example if I placed an order and there will be a position in MT5 broker. Then I'd be able to query the position info with PositionInfoString(ENUM_INFO_STRING) PositionInfoInteger(ENUM_INFO_INTEGER) In IB it seems being handled in a different way, it's only possible to get the position in siz...