ATC Trader User Guide    

Contents: Show all | Close all

 


 


Trade from Excel


Download Microsoft DDE Plugin here

Conception  

It is possible to use OEC API functionality inside Excel for users with different levels of programming knowledge.

 

1. User can drag-n-drop values from OEC Trader to Excel 
2. User can drag-n-drop DDE links from OEC Trader to Excel 
3. User can construct advanced DDE links and requests manually 
4. Excel add-in provides a set of functions to complement DDE functionality and support advanced commands in
 “electronic table” manner. 
For example, send order as “=SendOrder(“Buy”, A1, “ESU7”, “Limit”, A2)”.  .

OEC Excel Addin Installation

Excel 2007

The OEC Trader Excel Add-In installation adds itself to the Add-Ins list within Excel automatically. A user then can remove and return back this add-in manually using the below steps:  

1. Click Excel Options in Office button menu  

2. Select “Add-ins” options 

3. Select “Manage: Excel Add-ins” at the bottom of the “Excel Options” dialog and click “Go…”  

4. Press the “Automation” button 

5. Find the “OEC.Functions” item in the list and press ‘OK’  

6. Select “No” in the next Excel warning dialog box.  

7. Installation of the OEC Excel Add-in is complete.

Excel 2003 

The OEC Trader Excel Add-In installation adds itself to the Add-Ins list within Excel automatically. A user then can remove and return back this add-in manually using the below steps:  

1. In Excel open Add-Ins: Tools menu, Add-Ins…   

2. Press the “Automation” button 

3. Find the “OEC.Functions” item in the list and press ‘OK’  

4. Select “No” in next Excel warning dialog box.

5. Installation of OEC Excel Add-in is complete.  

Excel 2003 bugfix 

Excel 2003 has a bug that does not allow OEC Excel add-in to load. Before installing the OEC Trader Excel Add-in the user should update Excel 2003 via “Microsoft Update” site or download and install the following:
 http://www.microsoft.com/downloads/details.aspx?FamilyId=1B0BFB35-C252-43CC-8A2A-6A64D6AC4670&displaylang=en 

DDE links 

General

  OEC formats can be discovered via drop-n-drop operations: copy DDE links (see below) to Excel to view their format.   

General pattern:   

=|!?  

, where  

    OEC view related topic:
  • tik or quote for Quotes view 
  • acct or pos for Average Positions view 
  • ord for Orders view 
  • bal for Account Summary (Balance) view 
  • fill for fill details 
  • account for account specifications 
  • cntr for contract specifications 
  • dom for DOM 
  • hgram for histogram 
  • bars for bar history 
    OEC subject:  
  • Contract for Quotes view (ESU7, for example)
  • _ for Average Positions (TEST001_ER2U7, for example)
  • Order ID for Orders view
  •  
  • Account for Total Account Summary (TEST001, for example) and _ 
    for balance by currency (TEST001_EUR, for example)
  • Etc. Please see corresponding sections 
  

Column name is text in column header of corresponding view. (Last, LastVol, Bid, Ask in Quotes for example)  

Examples of DDE links in OEC formats:

  

=test1|quote!'6EU7?Last'
=test1|pos!'TEST01_ER2U7?#Bought'
=test1|ord!'1237963?Qty'
=test1|bal!'TEST_USD?Open P/L'
Another way to obtain OEC data is a usage of filtered indexed format:

=|!id[some filter]?  

All fields are the same as in the previous format, except the subject field. 
Now it describes the index of row in some filtered list and optionally – filter of this list. For example, =test1|pos!’id0[TEST001]?
Symbol’ returns the symbol name of first average position that has account “TEST001”. 
The filter can be skipped: =test1|ord!’id1?Order #’ returns ticket number of second order of TEST1 user. The syntax of the filter is:  

[Column_name1 ] value1 [AND [Column_name2 ]value2 [AND…]]

Example, Symbol = ESU7 AND State is Sent,Held,Working filters all open ESU7 orders.

Sometimes column name and operator can be skipped. For example, 
[ESU7] filters for all ESU7 orders or positions depending on topic;
 [Sent,Held,Working] filters for all open orders and the above full filter can be written as 
[ESU7 AND Sent,Held,Working] with the same effect. 
Please see corresponding sections below to find out what columns can be used by default.  

Account specifications: account 

Description of account 
Topic: account 
Subject:  account name 
Columns:  Account, CH, Category, Trader 
Default filter columns:  none

Balances: bal 

Balance values (total or by currency). This is the same functionality as the “Account Summary” view in OEC Trader 
Topic: bal 
Subject:  account name for total balance or _ for currency balance 
Columns:  Open P/L, Realized P/L, Total P/L, Cash, Net Liq, Rate 
Default filter columns:  indexed list is not applied 

Contract specifications: cntr 

Description of contracts.
    Topic: cntr 
Subject:  symbol
  Columns:  Symbol, Base Contract, Expires, Description, Currency, Exchange, Group, Type, Start Time, Stop Time, Tick Size, Per Point 
Default filter columns:  Symbol, Base Contract, Group, Exchange, Currency, Type. Acceptable values of Type are E/Electronic/Pit 

DOM: dom 

DOM values 
Topic: dom 
Subject:  symbol 
Columns:  price, size 
Additional parameter: index and side of level _
  Default filter columns:  not applied 
Examples 
 =TEST1|DOM!ESU7?price?0_Ask: first ASK price level of ESU7 DOM 
=TEST1|DOM!ESU7?size?1_Bid: size of second BID price level of ESU7 DOM 

Fills: fill

Fill details and state
Topic: fill 
Subject:  not applied
  Columns:  ID, Quantity, Price, Comments, Timestamp, Active, Commission, Type, Symbol
  Default filter columns:  Type, Symbol, Active 

Histogram: hgram
Histogram values 
Topic: hgram 
Subject:  symbol 
Columns:  price, size
  Additional parameter: index of value inside histogram sequence 
Default filter columns:  not applied 
Examples 
 =TEST1|HGRAM!FDAXU7?price?0: first price level in FDAXU7 histogram 
=TEST1|HGRAM!FDAXU7?size?1: size of second price level  

Historical data: bars 

Intraday historical data
  Topic: bars 
Subject:  symbol
  Special of column: ??
   : size of bars, in minutes 
: Time, Volume, Open, High, Low, Close 
: index of row in bar sequence. 0 is the latest bar, 1 is previous bar, etc 
Examples 
=TEST1|bars!ER2U7?15?Open?0: open price of the latest ER2U7 15-minute bar 
=TEST1|bars!ER2U7?5?Close?1: previous close price of ER2U7 5-minute bar

Orders: ord 

Order details and state. The same as “Open Orders” and “Complete Orders”
  Topic: ord 
Subject:  order ID 
Columns:  Order #, State, Avg.Price, Side, Qty, Symbol, Price, Last.Cmd, Comments, Time, Account, Type, Pending Command, Total Qty, Filled Qty 
Default filter columns:  State, Symbol, Account, Side, Flags 

Positions: pos

Average positions details. This is the same functionality as the “Average Positions” view in OEC Trader
  Topic: pos 
Subject:  _
  Columns:  Account, Symbol, #Prev, Prev.Price, #Bought, Avg. Buy Price, #Sold, Avg.
Sell Price, Net Pos, Net Pos. Price, Open P/L, $ Open P/L, Realized P/L, $ Realized P/L, Total P/L, $ Total P/L, Initial Margin, $ Initial Margin,
Maintenance Margin, $ Maintenance Margin  Default filter columns:  Symbol, Account 
Examaple 
= TEST1|pos!’TEST001_EMS7?#Prev’ 
= TEST1|pos!id0[EMS7]?Total P/L’ 

Realtime quotes:  quote 

Real-time quotes 
Topic: quote 
Subject:  symbol 
Columns:  Symbol, Last, LastVol, Bid, BidSize, Ask, AskSize, High, Low, Chg, Chg%,
TotalVol, Open, Settle, Updated, Base Contract, Expires, Description, Currency, Exchange, Group, Type, Start Time, Stop Time, Tick Size, Per Point 
Default filter columns:  Symbol, Base Contract, Group, Exchange, Currency, Type 

Send Order: send 

There is a special format for a Send Order request.
=|send!’Side_Qty_Symbol_Type_Price_Price2_Flags_BY_Account_Comments’  BY_Account:  The order will be sent to a specified account. 
‘BY’ is a termination word that means “the next word is an account name”
  Side: Buy | Sell 
Type:  Market | Limit | Stop |StopLimit | MarketIfTouched | MarketToLimit | MarketOnOpen | MarketOnClose | MarketOnPitOpen | MarketOnPitClose
  Flags: None | GTC | FOK | IOC | AON 
Price2, Flags and Comments are optional fields as well as the ‘BY_Account’ construction 
Examples 
=TEST1|send!’Buy_10_ESU7_Market’ 
=TEST1|send!’Buy_10_ESU7_Limit_1500.5’
  =TEST1|send!’Buy_10_ESU7_StopLimit_1550_1600’
  =TEST1|send!’Buy_10_ESU7_Market_GTC_BY_TEST001’
  =TEST1|send!’Buy_10_ESU7_Market_Some Comments’ 

Send OCO orders: oco 

There is a special format for a Send OCO Orders request 
=|oco!’order1_OCO_order2’
  Where order1 and order2 are normal orders (see Send Order for reference)
  Examples 
=TEST1|send!’Buy_10_ESU7_Limit_1500_OCO_ Buy_10_ESU7_Stop_1600’

 

Send Bracket orders: bracket 

There is a special format for a Send Bracket Orders request 
=|bracket!’order1_LINKED_order2’
  =| bracket!’order1_LINKED_order2_OCO_order3’
  Where order1, order2 and order3 are normal orders (see Send Order for reference)
  Examples
=TEST1|send!’Sell_10_ESU7_Market_LINKED_Buy_10_ESU7_Limit_1500_OCO_ Buy_10_ESU7_Stop_1600’

Cancel Orders

=|cxl!’Filter’ 
=|cxl!all 
The first case cancels only the orders that meet to conditions of filter. 
The second case cancels all open orders.
  The filter is the same as in ord topic + “Order #’ that can be used by default.
  Examples 
=TEST1|cxl!ESU7 
=TEST1|cxl!TEST001 
=TEST1|cxl!Held 
=TEST1|cxl!1356117 

Reach Desired Position

=|desired!’Symbol?desiredPosition?Account 
The request sends a command to OEC Trader to buy or sell the selected symbol
 in a selected account to reach the selected position.
  Example 
=test1|desired!ESU7?10?TEST001: This will initiate a Buy 5 ESU7 Market order,
 if current net position is 5.  

Dragndrop

General

The current version supports drag-n-drop operations from OEC Trader to Excel (from Quotes, Orders, Average Positions, Account Summary views). 

The user can drag a selected range of values as well as DDE links to these corresponding values. Proposed rules:

  1. Simple drag-n-drop operation copies selected range of values 
2. Starting ‘drag’ with Ctrl key will copy the selected range of values and column headers 
3. Finishing ‘drop’ with Ctrl key makes the DDE link to dynamic values (prices, for example) 
and copies any static values (contract names, for example).

OEC Excel addin Functions 

General 

OEC Excel add-in provides to user a set of functions to simplify DDE links construction within Excel. The set is divided to two categories: 
order manipulations (send and cancel requests) and table operations (dynamic loading of a growing table of orders and positions).  
This Excel add-in is optional and a user could work with DDE connectivity without it. 
The Excel add-in just helps to avoid the usage of non-business knowledge.  

Data set functions 

All table functions have one of the following two patterns:
  1. SomeFunction(username, range of column names, count of visible rows, filter)
  2. SomeFunction (username, range of column names, range of object identifies)
  These functions fill up a table precisely under the ‘range of column names’ with the DDE link. 
Column names play two roles here: header of table and source of the column names for automatically built DDE links.
 The length of table is controlled either through
 ‘count of visible rows’ or ‘range of object identifies’. 
These functions with the first pattern generates an array of links like the following:
   =username|!’id<#row>[filter]?’,
   The second one generates the following:
  =username|!’’?’
  For example, we have a list of order columns in the range of cells A6:K6 and want to show the first 100 working orders. 
Place the following function somewhere outside of result table. For example, place =Orders(“TEST1”, A6:K6, 100, “Working”) in B4. 
The result is an array of filled cells in range A7:K107 that will dynamically show the first 100 working orders.
  However, if we want to fill the column with order IDs (A7:A15, for example) 
and want to show the details of these corresponding orders, we would use a different function (with second pattern):
  =OrdersByID(“TEST1”, B6:K6, A7:A15)  

Below is a table of available functions:  

DOM, histograms and historical data functions 

These functions have specific formats 
DOM (username, contract, TRUE for ask or FALSE for bid, count of visible rows, cell of top right corner of result table)
Histogram (username, contract, count of visible rows, cell of top right corner of result table)
Bars (username, contract, size of bars in minutes, count of visible rows, range of column names)

Order manipulation functions

Send

Send(username, side, quantity, contract, type, price, price2, flags, account, comments, ready, cell to place DDE command)
The Send function concatenates parameters into a single DDE request and places it to a selected cell (last parameter),
 when the ‘ready’ parameter is TRUE. Moreover, when order is confirmed, 
the DDE request of this cell is replaced to OrderID to avoid duplicate requests.
  Please see the Send section that explains side, type and flags parameters (Price2, flags, account and comments are optional).  

OCO

OCO(username, side, quantity, contract, limit price, stop price, stop price2, flags, account, ready, cell to place DDE command)
This is the same as the Send function, but is constructed by simple a OCO DDE request: 
Limit and Stop/StopLimit pair of orders with the same side, quantity, contract, flags and account.  

Bracket

Bracket(username, side, quantity, contract, type of main order, price of main order, price2 of main order, price of Limit order, price of Stop order, price2 ofStopLimit, flags, account, ready, cell to place DDE command)
It is the same as Send and OCO functions, but is constructed by a simple bracket DDE request:
 main order and linked order or OCO orders depending on price values (zero price skips corresponding order). 
All orders will have the same quantity, contract, flags and account. Linked orders will have opposite side to main order.  

Cancel

Cancel(username, filter, ready, cell to place DDE command)
This Cancel function concatenates parameters into a single cxl DDE request and places it to a selected cell (last parameter),
 when the ‘ready’ parameter is TRUE.  

DesPos

DesPos(username, contract, desired position, account, ready, cell to place DDE command)
  This DesPos function concatenates parameters into a single desired DDE request and places it to a selected cell (last parameter),
 when the ‘ready’ parameter is TRUE.  

Sample 

The OEC Trader Add-in Installation includes a sample Excel file that shows the usage of the most of required functions and simple strategies availble.