Cyan Spring ATS
Open Source Algorithmic Trading Software
Configure Cyan Spring ATS
Configure Interactive Brokers Connection
This section provides the information of how to configure Cyan Spring ATS for Interactive Brokers connection.
Download and configure IB TWS or IB Gateway
Download Interactive Brokers TWS or Gateway here
Start up TWS/gateway and login with your account(you may want to login with a demo or paper trading account if you are first time playing with it). Change the API setting in TWS/gateway to "Enable ActiveX and socket clients".
Configure Cyan Spring ATSLook into server configuration file <installation directory>/server/conf/server_ib.xml and search for the section below:
<bean id="ibAdaptor" class="com.cyanspring.adaptor.ib.IbAdaptor"> <property name="host" value=""/> <property name="port" value="7496"/> <property name="clientId" value="1"/> <property name="logMarketData" value="false"/> </bean>
Host - Specify the host name of where you run IB TWS/Gateway. Leave it blank if you run Cyan Spring ATS server on the same host as IB TWS/Gateway.
Port - leave it to IB default 7496 unless you have changed it in IB TWS/Gateway settings.
Client Id - a unique client id for each connection.
Run Cyan Spring ATSRun server_ib.bat to start Cyan Spring Server. If the configuration was done well you should see a pop window from IB TWS/Gateway to prompt for accepting connection. Click Ok to continue. After server starts up successfully, you may start CSTW to play with the algo strategies.
Configure reference data
IB TWS/Gateway requires the API to pass in contract information for each instrument/stock you want to trade. This is done in <installation dir>\server\refdata\refData_IB.xml.You may take a look at the existing data in this file to add your own.