Page 1 of 1

What API settings should I use in TWS?

Posted: Thu Mar 22, 2018 10:53 am
by Rocket130713
Hello,

I have attached a screenshot of the TWS API settings I'm using for auto trading, are these settings correct and optimal? Also, what value should I enter for the "Master API client ID" setting in the TWS API settings? I'm using the following code for connecting to TWS and IB server "once" at TradeStation run-time:

ret_connect = CONNECT("",7496,1,1000);

Please see attachment below which shows all the TWS API settings I'm using. Would you recommend to change any of these settings?

Thank you in advance. Much appreciated.

Kind regards,

Rod

Re: What API settings should I use in TWS?

Posted: Thu Mar 22, 2018 2:09 pm
by board_admin
The settings look fine. Perhaps check create API log. Sometimes it is useful to clarify problems.

- Read only unchecked is clear
- Download open orders on connection not required, because TWSLink does this anyway.
- DDE not required, since you do not use Excel with DDE connectio TWS.

if you want to connect to TWS or Gateway from another machine,
you need to uncheck
-Allow connection from localhost only

and to provide the IP of the machine from which you want to connect to TWS/Gateway.

---

The master API clientid is for API clients who wants to have control about orders from
all API clients and i guess, this includes TWS orders.

So, if you call

Code: Select all

CONNECT("",port,master_id,100)
you can get control about all orders.

If you connection with clientid=0, you have also control about orders placed in TWS.