
|
QT Trading API - Penson/Meridian Specific
RML Trading - RMLPN.TRD
OC Securities - OCSEC.TRD
|

|
SEND COMMANDS (Client Application to QT Server)
The following SEND TYPE commands are supported for MB Trading:
| NEWORDER | - Sends a New Order to the broker |
| 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 |
| ClientOrderID | (Optional) Some value specified by the calling application that helps it identify the order. Any ACK or ERROR message returned for the transaction will include the ClientOrderID if it was specified |
| SymbolType | STOCK, OPTION, or FUTURE |
| Symbol | Symbol of the security to be traded |
| Action | For STOCKS: BUY, SELL, SHORT, COVER
For OPTIONS: Can also use BUY_OPEN, BUY_CLOSE, SELL_OPEN, SELL_CLOSE |
| OrderType | LIMIT, MARKET, STOPMARKET, STOPLIMIT, TSTOP |
| Quantity | Number of Shares or Contracts in the transaction |
| LimitPrice | LIMIT Price for Limit AND Stop Limit orders |
| StopPrice | STOP Price (Activation Price) for STOP orders, or Trail Amount for Trailing Stop |
| TIF | Time In Force: DAY, DAY+, GTC, FOK, IOC |
| Route | SMART or AUTO for default routing. For explicit routing, refer to the specific Broker GUI in QuoteTracker for routing options |
| Uncovered | YES/NO - Default: NO. For options orders only. Not available for OCSEC.TRD |
Some parameter value combinations are not available, such as OrderType: MARKET Route: INET.
Invalid orders will be rejected by the server and the rejection will be returned to you in a NOTIFICATION message
or as a rejected status on the order in a TRANSACTIONS message
EXAMPLE:
| |
<TRADEAPI>
<ID>MISCS1</ID>
<ACTION>SEND</ACTION>
<TYPE>NEWORDER</TYPE>
<PARAMS>
<ClientOrderID>TEST1234</ClientOrderID>
<Symbol>DELL</Symbol>
<Action>BUY</Action>
<OrderType>LIMIT</OrderType>
<Quantity>500</Quantity>
<LimitPrice>41.72</LimitPrice>
<TIF>DAY</TIF>
<Route>AUTO</Route>
</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>MISCS1</ID>
<ACTION>SEND</ACTION>
<TYPE>CANCELORDER</TYPE>
<PARAMS>
<OrderID>1227175600</OrderID>
<OrderID>1228893440</OrderID>
<OrderID>1220327423</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>MISCS1</ID>
<TYPE>ACK</TYPE>
<CLIENTORDERID>TEST1234</CLIENTORDERID>
<MESSAGE>Transaction submitted. The Order ID is: 1220327423</MESSAGE>
</TRADEAPI>
|
OR
| |
<TRADEAPI>
<ID>MISCS1</ID>
<TYPE>ACK</TYPE>
<MESSAGE>Cancel Order Sent - :A33005896:0015</MESSAGE>
</TRADEAPI>
|
|
 |
ERROR - Error while parsing command or error returned from the broker |
 |
|
Result returned in XML.
EXAMPLES:
| |
<TRADEAPI>
<ID>MISCS1</ID>
<TYPE>ERROR</TYPE>
<MESSAGE>Unable to get Positions data</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 |
| Action | BUY, SELL, etc. (Same as in NEWORDER) |
| Quantity | Number of Shares or Contracts in the transaction |
| FilledQuantity | Number of Shares or Contracts already filled |
| UnfilledQuantity | Number of Shares or Contracts yet to be filled |
| Symbol | Symbol of the security being traded |
| OrderType | LIMIT, MARKET, etc. (Same as in NEWORDER) |
| LimitPrice | LIMIT Price for Limit AND Stop Limit orders |
| StopPrice | STOP Price for STOP orders, or Trail Amount for Trailing Stop |
| TIF | Time In Force: DAY, DAY+, GTC, FOK, IOC (Same as in NEWORDER) |
| Route | SMART or AUTO, etc... (Same as in NEWORDER) |
| SymbolType | STOCK, OPTION, FUTURE |
| OrderStatus | Current Status of the order (Open,Executed,Partial,Canceling,Canceled,Pending,Ecn Busy,Ecn Down,Queued,T-Stop,Cancel Queued,Manual Order, Rejected: {text reason}) |
| Open | YES/NO - Whether or not this is an OPEN order - Still being processed |
EXAMPLES:
| |
<TRADEAPI>
<ID>MISCS1</ID>
<TYPE>TRANSACTIONS</TYPE>
<TRANSACTIONS>
<ORDER>
<OrderID>:A33005896:0015</OrderID>
<OrderTime>05/09/2005 15:08</OrderTime>
<Action>SELL</Action>
<Quantity>500</Quantity>
<FilledQuantity>0</FilledQuantity>
<UnfilledQuantity>500</UnfilledQuantity>
<Symbol>DELL</Symbol>
<OrderType>TSTOP</OrderType>
<StopPrice>2.50</StopPrice>
<TIF>DAY</TIF>
<Route>MBTX</Route>
<OrderStatus>Cancelled</OrderStatus>
<Open>NO</Open>
</ORDER>
</TRANSACTIONS>
</TRADEAPI>
|
|
 |
BALANCES - Current Balances information |
 |
|
Result returned in XML.
NOTE: The values for the NAME Field are coming directly from the broker servers. They can change without notice.
EXAMPLES:
| |
<TRADEAPI>
<ID>MISCS1</ID>
<TYPE>BALANCES</TYPE>
<BALANCES>
<BuyingPower>60875.42</BuyingPower>
<TotalEquity>43757.71</TotalEquity>
<MarketValue>53280.00</MarketValue>
<CashBalance>-9522.29</CashBalance>
<MaintExcess>30437.71</MaintExcess>
<MaintRequirement>13320.00</MaintRequirement>
<MarginEquity>0</MarginEquity>
<AccountType>Cash&Margin</AccountType>
<TotalPnL>30</TotalPnL>
<TotalValue>52695</TotalValue>
<TotalCost>52660</TotalCost>
</BALANCES>
</TRADEAPI>
|
|
 |
POSITIONS - Current Positions information |
 |
|
Result returned in XML.
EXAMPLES:
| |
<TRADEAPI>
<ID>MISCS1</ID>
<TYPE>POSITIONS</TYPE>
<POSITIONS>
<POSITION>
<Symbol>DELL</Symbol>
<SymbolType>STOCK</SymbolType>
<Quantity>400</Quantity>
<LastPrice>41.61</LastPrice>
<Cost>41.00</Cost>
<Value>16644</Value>
<Change>31.53</Change>
<OpenPL>244</OpenPL>
<Name>DELL Computers</Name>
</POSITION>
... More POSITION records ...
</POSITIONS>
</TRADEAPI>
|
|
|
|

|

|
|
|
|