QuoteTracker. Real-Time Intraday Charts, Quotes, Alerts, News Monitoring and Portfolio Management.
TD AMERITRADE Clients get QuoteTracker fully registered, FOR FREE! Open a TD AMERITRADE account today

 

SCREENS
BETA SITE
DOWNLOAD
TESTIMONIALS
REGISTRATION
INVESTOR
RESOURCES

SALES



QT Trading API - LOWTRADES (LOWTRADES.TRD)


SEND COMMANDS (Client Application to QT Server)

The following SEND TYPE commands are supported for Lowtrades:

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 Back to Top

 Parameter Name  Parameter Values and Description 
 Symbol Symbol of the security to be traded 
 Action BUY, SELL, SHORT, COVER 
 OrderType LIMIT, MARKET, STOPMARKET, STOPLIMIT 
 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 
 TIF Time In Force: DAY, DAY+, GTC 
 Route AUTO, DEFAULT or SMART (All get converted to DEFAULT), INET, ARCA, BRUT, DOT-BRUT, TRAC) 
 AccountType CASH or MARGIN 
 AON All or None: YES if set. NO if omitted 

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 OrderType: MARKET Route: INET. Invalid orders will be rejected by the server and the rejection will be returned to you in a NOTIFICATION message.

EXAMPLE:
     <TRADEAPI>
    <ID>MISCS1</ID>
    <ACTION>SEND</ACTION>
    <TYPE>NEWORDER</TYPE>
    <PARAMS>
        <Symbol>DELL</Symbol>
        <Action>BUY</Action>
        <OrderType>LIMIT</OrderType>
        <Quantity>500</Quantity>
        <LimitPrice>41.72</LimitPrice>
        <TIF>DAY</TIF>
        <Route>DEFAULT</Route>
        <AccountType>MARGIN</AccountType>
    </PARAMS>
</TRADEAPI>
{FF}

 
MODIFYORDER - Modifies an existing order Back to Top

 Parameter Name  Parameter Values and Description 
 OrderID REQUIRED - The Order ID of the order being modified. Should be retrieved from TRANSACTIONS 
 ..... The rest of the parameters are the same as in NEWORDER. (No SYMBOL or ACTION)

NOTE: Only the Order ID is required. For the other fields, only the ones that are modified need to be sent. The others can be omitted or you can send the value that was returned in TRANSACTIONS. HOWEVER, if making a change to the order type or route and there are fields that were applicable in the original order, but not in the new order, those fields should be sent with a null value.

EXAMPLE:
     <TRADEAPI>
    <ID>MISCS1</ID>
    <ACTION>SEND</ACTION>
    <TYPE>MODIFYORDER</TYPE>
    <PARAMS>
        <OrderID>AACV6881</OrderID>
        <LimitPrice>41.72</LimitPrice>
        <Quantity>300</Quantity>
        <AON>YES</AON>
    </PARAMS>
</TRADEAPI>
{FF}

 
CANCELORDER - Cancels one or more orders Back to Top

 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>AACV6881</OrderID>
        <OrderID>AACV6882</OrderID>
        <OrderID>AACV6883</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 Back to Top

Result returned in XML.
EXAMPLES:
     <TRADEAPI>
    <ID>MISCS1</ID>
    <TYPE>ACK</TYPE>
    <MESSAGE>Transaction Sent</MESSAGE>
</TRADEAPI>

  OR

 
     <TRADEAPI>
    <ID>MISCS1</ID>
    <TYPE>ACK</TYPE>
    <MESSAGE>Cancel Order Sent - AACV6881</MESSAGE>
</TRADEAPI>

 
ERROR - Error while parsing command or error returned from the broker Back to Top

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 Back to Top

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 
 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 
 FillDate Date/Time of last fill 
 FilledQuantity Number of Shares or Contracts that have been filled  
 UnfilledQuantity # of Shares or Contracts yet to be filled 
 FillPrice The execution price (Average if partial fills) 
 TIF Time In Force: DAY, DAY+, GTC (Same as in NEWORDER) 
 Route AUTO, DEFAULT, INET, etc... (Same as in NEWORDER) 
 SymbolType STOCK, OPTION 
 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 
 Tradedate Date/Time the order was sent to market 
 Strikeprice Strike Price (for Options symbols) 
 Comment Verbose comment - rejection reason 
 Commission Commission on the order 
 Accounttype CASH or MARGIN 

EXAMPLES:
     <TRADEAPI>
    <ID>MISCS1</ID>
    <TYPE>TRANSACTIONS</TYPE>
    <TRANSACTIONS>
        <ORDER>
            <OrderID>AACV6897</OrderID>
            <OrderTime>2005-05-27 11:10:19</OrderTime>
            <Action>SELL</Action>
            <Quantity>500</Quantity>
            <Symbol>DELL</Symbol>
            <OrderType>LIMIT</OrderType>
            <LimitPrice>40.50</LimitPrice>
            <TIF>DAY</TIF>
            <OrderStatus>Partial Fill: Open</OrderStatus>
            <Open>YES</Open>
            <Route>DEFAULT</Route>
            <FillDate>2005-05-27 11:10:21</FillDate>
            <FillPrice>40.51</FillPrice>
            <FilledQuantity>400</FilledQuantity>
            <UnfilledQuantity>100</UnfilledQuantity>
            <SymbolType>Stock</SymbolType>
            <TradeDate>2005-05-27 11:10:19</TradeDate>
            <Commission>2.50</Commission>
            <AccountType>Margin</AccountType>
        </ORDER>
    </TRANSACTIONS>
</TRADEAPI>

 
BALANCES - Current Balances information Back to Top

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>
        <CASH>25,258.50</CASH>
        <MARGIN>50,517.00</MARGIN>
    </BALANCES>
</TRADEAPI>

 
POSITIONS - Current Positions information Back to Top

Result returned in XML.
EXAMPLES:
     <TRADEAPI>
    <ID>MISCS1</ID>
    <TYPE>POSITIONS</TYPE>
    <POSITIONS>
        <POSITION>
            <Symbol>DELL</Symbol>
            <SymbolType>STOCK</SymbolType>
            <PositionType>Cash</PositionType>
            <Quantity>400</Quantity>
            <Cost>41.00</Cost>
        </POSITION>
        <POSITION>
            <Symbol>GOOG</Symbol>
            <SymbolType>STOCK</SymbolType>
            <PositionType>Margin</PositionType>
            <Quantity>500</Quantity>
            <Cost>174.23</Cost>
        </POSITION>
        ... More POSITION records ...
    </POSITIONS>
</TRADEAPI>