Hi,
I've seen in the documentation a table showing some IB order type. Is the documentation up to date? I ask this question, because the number of types supported by TWSLINK is lower than the number of order types in IB. Actually, my question is: is it possible to place a bracket order (order with Stop Loss and Take Profit values) with TWSLING and command PLACE_ORDER?
Thanks
Guillaume
IB Order type: bracket order ?
-
- Site Admin
- Posts: 244
- Joined: Mon Apr 24, 2017 3:24 pm
Re: IB Order type: bracket order ?
Hello,
you miss some ordertypes because TWSLink is no longer developped.
It is only changed for bugfixing.
Nevertheless, you will certainly be able to use it for a while yet.
However, bracket orders are not an own ordertype.
You create a brackt order by creating a master order with transmit=0,
a target (LMT) with parentid= master id and with transmit=0
and a stoploss (STP) with parentid= master id and with transmit=1.
(If you like to have only target or stoploss, you place the 2nd order
with transmit=1.)
Example:
you miss some ordertypes because TWSLink is no longer developped.
It is only changed for bugfixing.
Nevertheless, you will certainly be able to use it for a while yet.
However, bracket orders are not an own ordertype.
You create a brackt order by creating a master order with transmit=0,
a target (LMT) with parentid= master id and with transmit=0
and a stoploss (STP) with parentid= master id and with transmit=1.
(If you like to have only target or stoploss, you place the 2nd order
with transmit=1.)
Example:
Code: Select all
uid_contract=REGISTER_CONTRACT("MSFT","STK","USD","SMART","","","",0,"",0,0)
CONNECT("",7496,1,1000)
// master order
uidmaster=PLACE_ORDER(uid_contract,0,"BUY","MKT",100,0,0.0,"GTC",0,0)
// take profit order
PLACE_ORDER(uid_contract,0,"SELL","LMT",100,50,0.0,"GTC",0,uidmaster)
// stop loss order
PLACE_ORDER(uid_contract,0,"SELL","STP",100,0,5,"GTC",1,uidmaster)
Re: IB Order type: bracket order ?
Thanks for the code. I understand how orders work.
I didn't know that TWSLink was obsolete. I saw a recent update for Perl wrapper. Would you say the project is enough mature to use it?
I didn't know that TWSLink was obsolete. I saw a recent update for Perl wrapper. Would you say the project is enough mature to use it?
-
- Site Admin
- Posts: 244
- Joined: Mon Apr 24, 2017 3:24 pm
Re: IB Order type: bracket order ?
I didn't say obsolete. You still can use it and i am sure also in the coming years.
But it is not further developped. When IB adds a new features to their IB,
TWSLink is not adjusted.
The Perl wrapper was an exception.
Yes, it is matured. Since years. You can test it 3 weeks for free.
But it is not further developped. When IB adds a new features to their IB,
TWSLink is not adjusted.
The Perl wrapper was an exception.
Yes, it is matured. Since years. You can test it 3 weeks for free.
Re: IB Order type: bracket order ?
OK, thanks for your answer.
I don't understand why you say I can use TWSLink during 3 weeks for free, because on your webpage you say that TWSLink is completely free without any limitation.
Guillaume
I don't understand why you say I can use TWSLink during 3 weeks for free, because on your webpage you say that TWSLink is completely free without any limitation.
Guillaume
-
- Site Admin
- Posts: 244
- Joined: Mon Apr 24, 2017 3:24 pm
Re: IB Order type: bracket order ?
Ah sorry yes,I stucked in the past. Forget the comment.
You can use it unlimited for free.
You can use it unlimited for free.