TWSLINK-FAQ                       TWSLink

  Q:    When I call one of the exported functions or a specific exported function, the calling application or script crashes or hangs and function never returns.
 

This mostly happens due to a wrong list of parameters passed to the exported function or due to incompatible datatypes for one ore more parameters passed to exported functions. Check the list of parameters encountered in the documentation of TWSLink and compare this list with the parameters passed on call in your application or script. The number of passed parameters must exactly match to the number given in the documentation. The single and total number of bytes for each and all parameters must exactly match to the number of bytes resulting by the number of paramters. The are only 3 diferent types of parameters for all exported functions:
                long
(integer) and       4 Bytes.
                char pointer
(string)    4 Bytes (on 32 bit machines).
                double (decimal) -      8 Bytes.
 

  Q: When I place an order and after this attach another order and transmit the parent order or the client order, then parent- or client order sometimes stays untransmitted to IB.
 

This can happen if one of the orders are already known at TWS Side (Transmission Flag >= 0) before they got attached. The savest and smartest method to place attached orders or more generally spoken: to change order properties (an attachment is an order property) is to perform all changes before the order is known at TWS Side and then to transmit a complete order in one step. That is by setting the transmission flag to -1 first and after having changed all order properties to call Function Transmit.

   
  Q: When I use TWSLink with eSignal EFS (especially Version 2), EFS hangs when unloading the Script.
  This can happen if TWSLink was started with Trace Window enabled (flag = 4096). Start the EFS Script without the Trace Window.
   
  Q: Positions for CASH Contracts are always returned with ZERO.
  Open TWS Account Window and check field "Include FX positions in portfolio".