Announcement

Collapse
No announcement yet.

Setting IB field "Order Reference"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Setting IB field "Order Reference"

    IB TWS has many fields or attributes for orders. Many of them do not apply to EFS-AT because not all order types are supported from EFS.

    There is an Order Ref field on TWS which typically starts with "{ORTH}". Is there a way EFS can set this field to some other value, which varies depending on the situation or the source script submitting the order? I would like to use this field to convey information to another external program. However, the Order Ref field could also be useful when multiple scripts trade the same ticker but implement different strategies.

    My inquiry can be extrapolated to any order attribute. I checked Order.getFieldNames for a list of fields which can be read, and there are many fields which I do not know how to set from EFS (if the need existed). Is there a way to modify other order attributes from EFS (even a complicated approach)? For example, Order.setFieldValue( FieldName, OrderID ) would probably be the function I am seeking. There may be some dangers with such functionality, but used in a responsible manner setting order field values need not introduce new risks.
    Last edited by omerproteus; 11-20-2015, 10:19 AM.

  • #2
    I have no further insights into modifying the Order Ref field in TWS for orders created by EFS. This would be a brilliant enhancement to EFS-AT because it would allow order info from TWS to tie back to the EFS script, when different scripts are trading the same symbol. Otherwise, if one symbol can be traded by different scripts, each script must trade in a unique IB account. In other words, each unique combination of symbol and script must map to only one IB account.

    Currently, TWS Order Ref is unique to the symbol, not the order. For example, ETF ticker SHV has an Order Ref of "{ORTH}42454579+SHV(SHV)-STK-USD:SMART" for every order using SHV.

    From my experience using another product for automated trading on TWS, I was able to specify the Order Ref field. Looking at IB's API documentation, an external program can access the Order Ref attribute (which presumably means it can set the string). The excerpt below suggests that it is useful for keeping track of multiple API's running concurrently, which is true, but I feel it can be useful when multiple EFS scripts are running.



    String m_orderRef
    The order reference. Intended for institutional customers only, although all customers may use it to identify the API client that sent the order when multiple API clients are running.

    Comment

    Working...
    X