
|
QT Trading API - PATSYSTEMS Specific
Global Futures - GLOBALFUTURES.TRD
|

|
SEND COMMANDS (Client Application to QT Server)
The following SEND TYPE commands are supported for TRADESTREAM:
| NEWORDER | - Sends a New Order to the broker |
| MODIFYORDER | - Modifies an existing order |
| CANCELORDER | - Cancels one or more orders |
| REFTRAN | - Forces a refresh of transactions. No parameters |
| REFBAL | - Forces a refresh of Balances and Positions. No parameters |
NOTIFICATION RESPONSES (QT Server to Application)
The following is a list of Notification TYPES that can be returned:
| ACK | - acknowledgement of a successful order transaction. |
| ERROR | - Error while parsing command or error returned from the broker |
| TRANSACTIONS | - List of transactions for the day |
| BALANCES | - Current Balances information |
| POSITIONS | - Current Positions information |
SEND COMMANDS DETAILS
 |
NEWORDER - Send a New Order to the broker |
 |
|
| Parameter Name | Parameter Values and Description |
| Symbol | Symbol of the security to be traded. Can be either QT symbol or full PATS symbol as entered in QT |
| Action | BUY, SELL, SHORT, COVER
| | OrderType | LIMIT, MARKET, STOPMARKET, STOPMARKET#, STOPLIMIT, STOPLIMIT#, TSTOP, or any valid PATS Order Type |
| Quantity | Number of Contracts in the transaction |
| LimitPrice | LIMIT Price for Limit, and Stop Limit orders. |
| StopPrice | STOP Price (Activation Price) for STOP orders |
| LinkedOrder | Order ID of the order linked to this order if it is an OCO order.
| | TriggerNow | Y/N (Default Y if omitted) - A char variable indicating if synthetic orders should be checked (and triggered if necessary) immediately rather than awaiting a price update message.
|
NOTE: Very little error checking is done for API order prior to sending them to the broker.
Some parameter value combinations are not available, such as certain order types for securities on some exchanges.
Invalid orders will be rejected and the rejection will be returned to you in a NOTIFICATION message.
EXAMPLE:
| |
<TRADEAPI>
<ID>TS1</ID>
<ACTION>SEND</ACTION>
<TYPE>NEWORDER</TYPE>
<PARAMS>
<Symbol>CME:MINI S&P+SEP05</Symbol>
<Action>BUY</Action>
<OrderType>STOPLIMIT</OrderType>
<Quantity>4</Quantity>
<LimitPrice>1196.25</LimitPrice>
<StopPrice>1196.00</StopPrice>
<LinkedOrder>-</LinkedOrder>
<TriggerNow>Y</TriggerNow>
</PARAMS>
</TRADEAPI>
{FF}
|
|
 |
MODIFYORDER - Modifies an existing order |
 |
|
| Parameter Name | Parameter Values and Description |
| OrderID | The Order ID of the order being modified. Should be retrieved from TRANSACTIONS |
| Quantity | New Number of Contracts in the transaction |
| LimitPrice | LIMIT Price for Limit orders |
| StopPrice | STOP Price for STOP orders |
NOTE: Any of the Parameters that are NOT included will be kept un-changed in the order.
Anything that IS specified will be changed to the new value in the order.
EXAMPLE:
| |
<TRADEAPI>
<ID>TS1</ID>
<ACTION>SEND</ACTION>
<TYPE>MODIFYORDER</TYPE>
<PARAMS>
<OrderID>696434</OrderID>
<Quantity>14</Quantity>
<LimitPrice>1195.25</LimitPrice>
<StopPrice>1195.00</StopPrice>
</PARAMS>
</TRADEAPI>
{FF}
|
|
 |
CANCELORDER - Cancels one or more orders |
 |
|
| Parameter Name | Parameter Values and Description |
| OrderID | The Order ID of the order to be canceled. |
NOTE: To cancel more than one order at a time, just include multiple OrderID XML tags, one for each order
EXAMPLE:
| |
<TRADEAPI>
<ID>TS1</ID>
<ACTION>SEND</ACTION>
<TYPE>CANCELORDER</TYPE>
<PARAMS>
<OrderID>696434</OrderID>
<OrderID>696442</OrderID>
<OrderID>696436</OrderID>
</PARAMS>
</TRADEAPI>
{FF}
|
|
NOTIFICATION RESPONSES
NOTE: The examples below will not show Record ID or Record Length for simplicity, even though they are sent with every message.
 |
ACK - Acknowledgement of a successful order transaction |
 |
|
Result returned in XML.
EXAMPLES:
| |
<TRADEAPI>
<ID>TS1</ID>
<TYPE>ACK</TYPE>
<MESSAGE>Cancel Order Sent - 1372343999
</MESSAGE>
</TRADEAPI>
|
OR
| |
<TRADEAPI>
<ID>TS1</ID>
<TYPE>ACK</TYPE>
<MESSAGE>Transaction Sent
</MESSAGE>
</TRADEAPI>
|
|
 |
ERROR - Error while parsing command or error returned from the broker |
 |
|
Result returned in XML.
EXAMPLES:
| |
<TRADEAPI>
<ID>TS1</ID>
<TYPE>ERROR</TYPE>
<MESSAGE>Error sending cancel command - Order 1372343999</MESSAGE>
</TRADEAPI>
|
|
 |
TRANSACTIONS - List of transactions on the account for the day |
 |
|
Result returned in XML.
| Parameter Name | Parameter Values and Description |
| OrderID | Order ID of the order |
| OrderTime | Date/Time the order was Placed |
| Symbol | Symbol of the security being traded |
| Action | BUY, SELL, etc. (Same as in NEWORDER) |
| Quantity | Number of Shares or Contracts in the transaction |
| FilledQuantity | Number of Shares or Contracts that have been filled |
| UnfilledQuantity | # of Shares or Contracts yet to be filled |
| OrderType | LIMIT, MARKET, etc. (Same as in NEWORDER) |
| LimitPrice | LIMIT Price for Limit AND Stop Limit orders |
| StopPrice | STOP Price for STOP orders |
| OrderStatus | Current Status of the order (New, Open, Routed, Locked for Routing, Wait for Approval, Routed Change, Locked for Change Routing, New Change, Partial Fill: Open, Trailing Stop, Routed Cancel, New Cancel, Open Cancel, Change Requested, Locked for Cancel Routing, Executed, Partial Fill: Canceled, Partial Fill: Expired, Canceled, Expired, Rejected ECN, Rejected, Busted) | | Open | YES/NO - Whether or not this is an OPEN order - Still being processed |
| FillPrice | The execution price of filled orders (Average if partial fills) |
EXAMPLES:
| |
<TRADEAPI>
<ID>TS1</ID>
<TYPE>TRANSACTIONS</TYPE>
<TRANSACTIONS>
<ORDER>
<OrderID>695959</OrderID>
<OrderTime>07/05/2005 04:49:39</OrderTime>
<Action>SHORT</Action>
<Quantity>2</Quantity>
<Symbol>CME:MINI S&P+SEP05</Symbol>
<FilledQuantity>2</FilledQuantity>
<UnfilledQuantity>0</UnfilledQuantity>
<OrderType>LIMIT</OrderType>
<LimitPrice>1201.00</LimitPrice>
<OrderStatus>Filled</OrderStatus>
<Open>NO</Open>
<FillPrice>1201.00</FillPrice>
</ORDER>
</TRANSACTIONS>
</TRADEAPI>
|
|
 |
BALANCES - Current Balances information |
 |
|
Result returned in XML.
EXAMPLES:
| |
<TRADEAPI>
<ID>TS1</ID>
<TYPE>BALANCES</TYPE>
<BALANCES>
<BPRemaining>0.0</BPRemaining>
<BPUsed>0.0</BPUsed>
<LossLimit>0.00</LossLimit>
</BALANCES>
</TRADEAPI>
|
|
 |
POSITIONS - Current Positions information |
 |
|
Result returned in XML.
EXAMPLES:
| |
<TRADEAPI>
<ID>TS1</ID>
<TYPE>POSITIONS</TYPE>
<POSITIONS>
<POSITION>
<Symbol>ES+U5</Symbol>
<Name>MINI S&P</Name>
<Quantity>4</Quantity>
<BUYS>4</BUYS>
<SELLS>0</SELLS>
<PROFIT>0</PROFIT>
</POSITION>
<POSITION>
<Symbol>SIM:GLBX EURO+SEP05</Symbol>
<Name>GLBX EURO</Name>
<Quantity>2</Quantity>
<BUYS>2</BUYS>
<SELLS>2</SELLS>
<PROFIT>0</PROFIT>
</POSITION>
... More POSITION records ...
</POSITIONS>
</TRADEAPI>
|
|
|
|

|

|
|
|
|