Developers can use SWP API to integrate Stock Watch Pro with their own applications. SWP API allows you to capture orders originating from Level I, Level II, Charts, or trigerring alerts. API broadcasts a window message with a string containing order details. Your application can listen for this message and parse the order string for further processing.

Click here for the source code of a sample application which listens for Stock Watch Pro messages and prints out order details. It registers to listen for SWP_ORDER messages using RegisterWindowMessage() and processes them in OnOrderMessage() handler. The order string is passed as an atom in wp parameter of OnOrderMessage() handler. It is retrieved using GlobalGetAtomName() and then parsed to retrieve the order info. The order string consists of field=value pairs separated by semicolons. Here is a table of fields and their common values:

FieldDescriptionValues
SymbolSymbol for which the order was initiatedany string
ActionWhether buying or sellingBuy, BuyCover, Sell, SellShort
QtyNumber of sharesany number
OrderOrder typeMarket, Limit, Stop, StopLimit, FOK (Fill or Kill), any string
PriceOrder priceany double
RouteOrder routingDefault, SOES, SelectNet, ECN, any string
MMMarket Maker or ECNany string
ExpireWhen the order expiresDay, GTC (Good till cancelled), any string
StopLimitStop limit price (optional)any double

Examples:

An order can be initiated using one of the following methods:

To enable API messages, go to the Trading tab of Preferences dialog (click on Edit --> Preferences) and select API from the dropdown list. Click on Settings button to configure API options: