0
votes

My summer project is developing an algorithmic trader that receives market data and trades based off indicators. I pull data from a company called Interactive Brokers using their TWS(Trader workshop station). I have downloaded their Excel API which uses DDE, but cannot get the Excel spreadsheet to properly connect with TWS.

In my excel spreadsheet, I wrote this command into a random cell. I've replaced 'sample123' with my TWS username It is suppose to evaluate to 0 before I make other adjustments but it evaluates to #REF!:

=Ssample123|tik!'id1?req?EUR_CASH_IDEALPRO_USD_~/'

Image of error received

Another issue with the error is it deletes two characters off my username and I am unsure of why.

Ex: username -> Sample123 Outcome -> Sample1

Any suggestions would be greatly appreciated! Thank you and have a nice day.

1
The error clearly states that the DDE application is not running. Thus Excel takes first part of DDE formula to be the application program name and tries starting SSAMPLE1.EXE. The application program name is truncated to 8 characters because of DDE is ancient technology from ancient times where file names only had could be 8 characters long. Have you followed "Tutorial: Requesting Real-Time Market Data - What You Will Need"? - Axel Richter
Yes, that is one of the resources I've been using. I also have "enable activeX and socket clients" and "enable dde clients" both on so I don't understand why the DDE is not running? So do you believe the core error here is the truncation? - David
I tried a user name of 8 characters and It still runs me the same initial error. I believe the beginning of each string automatically begins with an S so it will always loose at best a character. What are the steps to fix this problem? - David
The core error is not the truncation but that DDE application probably is not running. "2. Log into TWS, which must be up and running while you are using the DDE for Excel API." - Axel Richter
I downloaded the TWS software and I have it logged in and running in the background. It still doesn't work. Is it possibly the path excel has setup for the TWS? - David

1 Answers

0
votes

'sample123' in the example formula is the username that was used to login to TWS. It has to be replaced in your formulas with the actual username you used to login to TWS.

Also, to use the older legacy TWS DDE API you have to be running 32 bit TWS and have the setting "Enable DDE" checked in TWS Global Configuration.

Issues causing the #REF error

There is a newer 'DDE Socket Bridge' TWS API also available in the Latest version of the API which has additional functionality and is compatible with the 64 bit version of TWS.

DDE SocketBridge API