AlgoOrder Time-Weighted Average Price (TWAP)

 

 

 

A TWAP order is a multi-leg order.

Each leg contains some number of contracts determined by chunk size (see preferences). The sum of the contracts in all legs is equal to the total order quantity.

Each leg order (chunk) is placed at the frequency you set in preferences.

To change the price of subsequent leg order, select an interval using the distance parameter.

When you place a TWAP order, the TWAP application places leg orders as specified in preferences.

If the order type is not market and if distance is not zero, then the application places the first chunk at the given order price and each subsequent chunk at a number of ticks away (specified by distance) from the market price.

If distance is zero, then the application places leg orders at the price specified in the CQG trading application you used to place the TWAP order.

If you place a market TWAP order, the distance parameter is ignored and the application places market orders using the specified chunk size at the specified time intervals.

Installing, running, and stopping TWAP

1.  Open CQG software, and log on to trade.

2.  From CQG’s website, download and run the installation program for TWAP (AlgoOrder TWAP.msi).

If you plan on using the source code in any way, make sure to install the application and the source (Custom Setup).

3.  Go to Start > All Programs > CQG > AlgoOrderTWAP to register the type, so that it can be viewed in the software.

4.  In the CQG software, open a trading application. Note that the AlgoOrder type is now listed on the special orders menu.

The TWAP application runs in the background of the CQG software. The TWAP icon is visible in the system tray when it’s running.

Right-click that icon to open a menu of options, explained later in this topic, associated with TWAP orders.

 

Use this menu to stop the TWAP application. When you do so, all working algorithmic orders placed with current instance of the application are cancelled.

TWAP parameters

Parameter

Description

Chunk Size

Number of contracts for each leg.

Default = 1 contract

Time Interval

Time between leg order placement.

Default = 60 seconds

Distance

Number of ticks from market.

Default = 0 ticks

Execute Immediately

Default = on

Execution Start

Default = current time

 

Monitoring and cancelling TWAP orders

Right-click the TWAP icon in the system tray, then click Monitor to open the Monitor window. The window lists working orders with associated data:

      Algo Order ID, format COTWAPxxxxyyyy, where:

xxxx = Serial number of the algorithmic order placed through the application's current session. This value is reset after restarting the application.

yyyy =  Serial number of the leg for the xxxx algorithmic order. This value is reset for each algorithmic order.

Z = multi-digit serial number of orders placed through the given instance of the application.

      Status

      FCM Account ID

      Account Name

      Instrument Name

      Side

      Type

      Limit Price

      Stop Price

      Total Quantity

      Filled Quantity

      Chunk Size

      Time Interval

      Distance

      Execute Immediately

      Execution Start

To cancel one or some of the working orders, select them and then click the Cancel Checked Orders button. You can also right-click the order.

To cancel all working orders, click the Cancel All Orders button. You can also right-click the order.

Cancel leg orders using CQG software.

To obtain log files, right-click the TWAP icon in the system tray, then click Show Logs. The local folder that contains logs is opened: C:\Users\<name>\AppData\Local\CQG\AlgoOrder_TWAP\Logs

TWAP Profile Manager

Set parameter values using Profile Manager. Right-click the TWAP icon in the system tray, then click Profile Manager.

TWAP Configuration Manager

Change naming, tooltip, and log settings using Configuration Manager. Right-click the TWAP icon in the system tray, then click Configuration Manager.

Setting

Description

Long Name

Name that is displayed in the Special Orders drop-down list in CQG software.

Short Name

Short form of order type name used in the algo order ID and UENames (system uses first four characters).

Also used on the special orders menu in the software.

Balloon Tip Level

Determines lower level of importance that should be used to filter out events to be displayed as tool tips in the system tray area.

None: Nothing is displayed.

Info: All events are displayed.

Warning: Warning or error events are displayed.

Error: Only error events are displayed.

Log Level

Messages are delivered to the log file.

None: Nothing is logged.

Info: All events are logged.

Warning: Warning or error events are logged.

Error: Only error events are logged.

Log File Max Size

Determines maximum size of log file. When reached, a new log file is created.

Maximum allowed file size = 32768 KB or 32 MB.

Log Files Max Count

Determines the maximum number of log files. When reached, the oldest file is deleted before a new file is started.

Maximum allowed number of log files = 100.