PPro8 PProAPI

Important information

When using the PProAPI, keep the following in mind:

  • The API user is responsible for all profits/losses associated with order activity generated by the API
  • API-generated order activity is subjected to all the same checks and surveillance as manual order activity
  • It is the API user’s responsibility to monitor his or her trade activity in real time
  • If an API user generates problematic order activity using the API, access may be restricted until such time as the user can demonstrate that corrective action has been taken

Disclaimer: limited support
The assumption is that users of the API have a basic knowledge of programming and how to integrate URL calls with other tools, and as a result the support provided is limited, for the most part, to the documentation found below.

It is entirely up to the user how they want to interact with the API. It is possible to use the URL calls and process the CSV data using any programming language.

Overview

The PPro8 API is a web service which, when enabled, allows the user to pass commands using URL format:

? 

To enable access to PProAPI, go to Metro: General Processes: Trader Management: Trading Parameters: API Access. For more information, see the Trader Management Process Manual

Note: when UDP is set up, the commands do not receive responses in XML nor in .log files. Instead, the API server responds with HTTP headers. If a command fails, the server returns 400 bad requests. Without UDP set up, using regular URL instead, expected behaviour is 200 good requests.

To launch the PProAPI, a user launches the PPro8 client with the following command:

PPro8.exe -pproapi_port=8080

Note: any port may be used; 8080 is just used in all examples. If you choose to use a different port, we recommend you limit yourself to the range from 1000–65535, as ports below 1000 are often predefined by the operating system.

When logged in, the user can go to the PProAPI portal using this link: http://localhost:8080 . This portal will have a basic summary of the currently available commands.

Note: throughout this instruction manual, example URLs are presented omitting http://localhost:8080 . For all examples below, first type http://localhost:8080/ followed by the command.

UDP functionality

To ensure proper UDP functionality, code your application to actively listen to the port.

If you want to verify UDP functionality, we recommend using NetCat and its accompanying cheat sheet for this purpose.

To use NetCat, launch it with the following command line, for example:

-ul -p4135

…where:

-u is UDP
-l means “listening to”
-p is port, the number of which varies depending on the registration being sent

…taken together, this command line means “UDP port 4135 is actively listening.”

You can then use the command line to register and send data to a port you set.

For example:

Register L1 data for ATML.NQ and send data to UDP port 4135.

http://localhost:8080/SetOutput?region=1&feedtype=L1&output=4135&status=on

Example response:

LocalTime=08:53:20.845,Message=L1,MarketTime=08:53:20.551,Symbol=ATML.NQ,BidPrice=8.05000,BidSize=4700,AskPrice=8.07000,AskSize=2500,Tick=D

Registration

Use the Register command to register for each of the available data types.

In each registration, writing an individual file is specified by the bykey syntax part in the following manner:

Register?symbol=&region=[1|2|3|4]&feedtype=[L1|TOS|L2|IMBALANCE|OSTAT|ORDEREVENT|PAPIORDER]&output=[bykey]

On the other hand, bytype sends all registered symbol data to a specified file.

Syntax:

Register?symbol=&region=[1|2|3|4]&feedtype=[L1|TOS|L2|IMBALANCE|OSTAT|ORDEREVENT|PAPIORDER]&output=[bytype]

If the specified file contains TOSL1L2, and OSTAT, you can choose which symbol goes to the specified file (bytype), or write to a separate file (bykey) for a symbol.

Register commands

Syntax:

Register?symbol= & region=[1|2|3|4] & feedtype=[L1|TOS|L2|IMBALANCE|OSTAT|ORDEREVENT|PAPIORDER]

Return:

<RegistryQueueSize PProApi="" NCSA="" EMEA="" APAC="" />

Example:

Register?symbol=ZVZZT.NQ&feedtype=TOS

New: the Register command is now supported for Manager accounts, for the OSTAT and ORDEREVENT feed types only. For OSTAT / ORDEREVENT, messages pass the region parameter.

The Register command is divided into three separate commands: GetSnapshot, Register, and SetOutput.

Using these commands, you can set the output and enable or disable it being written by setting the status on/off and writing only snapshot, live data, or both, depending on the command.

GetSnapshot

Use this command to get existing data (the last 100 records, but no new data) for the symbol.

Note: for the Level 1 (L1) feedtype, this command returns only two records.

Syntax:

GetSnapshot?symbol= & region=[1|2|3|4] & feedtype=[L1|TOS|L2]

Example:

GetSnapshot?symbol=ZVZZT.NQ&feedtype=TOS

Notes

  • For L1, L2, or TOS data, must pass the symbol parameter
  • 'Lv1' and 'Tos' are deprecated but still available, please update your scripts to use 'L1' and 'TOS'

Register

Use this command to register live data and get new information for the symbol.

Syntax:

Register?symbol=ZVZZT.NQ&feedtype=TOS

SetOutput

Use this command to set the output information for the symbol and define where the data should be written, either bykey or bytype.

New: the SetOutput command is now supported for Manager accounts, for the OSTAT and ORDEREVENT feed types only. For OSTAT / ORDEREVENT, messages pass the region parameter.

Syntax:

SetOutput?symbol= & region=[1|2|3|4] & feedtype=[L1|TOS|L2|IMBALANCE|OSTAT|ORDEREVENT|PAPIORDER] & output=[bykey|bytype|] & status=[on|off]

Example:

SetOutput?symbol=ZVZZT.NQ&feedtype=L1&output=bykey&status=on

Notes

  • For IMBALANCE / OSTAT / ORDEREVENT / PAPIORDER, messages pass the region parameter.
  • For L1, L2, or TOS data, must pass the symbol parameter.
  • 'Lv1' and 'Tos' are deprecated but still available. Update your scripts to use 'L1' and 'TOS'.
  • output=1234 means output is broadcast to localhost UDP port 1234
  • L1 will also generate output files for:
    • InstrumentUpdate (IU_*)
    • SummaryUpdate (SU_*)
    • AlertMessages (AM_*)
    • AuctionInfo (AI_*)

GetOstats

Syntax:

SetOutput?region=1&feedtype=OSTAT&output=bytype&status=on

Syntax for UDP registrations:

<SetOutput?region=1&feedtype=OSTAT&output=4321&status=on

Level 1 (L1)

Example:

Register?symbol=ZVZZT.NQ&feedtype=L1

This command registers the API to receive all Level 1 price/size updates for symbol ZVZZT.NQ. These updates are written to a file in the PPro8 launch directory with the name L1_1_ZVZZT.NQ.log, where the number represents the region. The regions are as follows:

  • 1 – NCSA
  • 2 – EMEA
  • 3 – APAC
  • 4 – AUNZ

Note: please ensure that you register for the correct region with all relevant commands.

Messages for L1 must include the symbol parameter.

Each L1 update is a comma-separated line of data with the following fields:

  • LocalTime=09:07:29.349 ← the time the update arrived on the user's machine and uses the user's computer's time
  • MarketTime=09:07:30.379 ← the market time of the update
  • Symbol=XIU.TO ← the symbol the update applies to, in the format .
  • BidPrice=19.19 ← the bid price of the L1 update
  • BidSize=8000 ← the bid size of the L1 update
  • AskPrice=19.24 ← the ask price of the L1 update
  • AskSize=16000 ← the ask size of the L1 update
  • Tick=? ← whether the latest update is related to an uptick/downtick on markets, where applicable

Time of Sales (TOS)

Example:

Register?symbol=ZVZZT.NQ&feedtype=TOS&output=[bykey|bytype]

This command registers the API to receive all Time of Sales prints for symbol ZVZZT.NQ. These updates are then written to a file in the PPro8 launch directory with the name TOS_1_ZVZZT.NQ.log.

Messages for TOS must include the symbol parameter.

TOS messages are stored in a separate file for each registered symbol.

Each TOS update is a comma-separated line of data with the following fields:

  • LocalTime=09:30:15.375 ← the time the update arrived on the user's machine and uses the user's computer's time
  • MarketTime=09:30:14.887 ← the market time of the update
  • Type=1 ← the type of snapshot data coming in
  • Price=8.63 ← the price at which the trade occurred
  • Size=100 ← the number of shares involved in the trade
  • Source=17 ← an internal value for mapping to the quote source
  • Condition=? ← the Sales Condition value, where applicable
  • Tick=? ← identifies the trade as an uptick/downtick on markets, if applicable
  • MmId=C ← the market center on which the trade occurred
  • SubMarketId= ← the submarket center on which the trade occurred, if applicable

Information for the Type parameter:
Type 0 = live feed
Type 1 = start of snapshot
Type 2 = snapshot record
Type 3 = end of snapshot

Live feed data starts once the user registers for the feed.

Note: snapshot data is not duplicate data. Rather, it is historical data showing the last 100 TOS prints before the user registered for the feed. Snapshot records can be processed if the user wants to get an idea of symbol sales from directly prior to the TOS registry. The snapshots are used to populate the TOS window when a symbol is registered to it, and since the API makes the same calls as the software, the TOS is included here as well.

Examples:

LocalTime=21:32:59.193,MarketTime=00:00:00.000,Symbol=WBC.AX,Type=1,Price=0,Size=0,Source=0

 

LocalTime=21:34:52.322,MarketTime=11:33:15.929,Symbol=WBC.AX,Type=2,Price=34.445,Size=59,Source=0,Condition=?,Tick=?,Mmid=C,SubMarketId=

 

LocalTime=21:32:59.209,MarketTime=00:00:00.000,Symbol=WBC.AX,Type=3,Price=0,Size=0,Source=0

 

LocalTime=21:34:42.916,MarketTime=11:34:41.913,Symbol=WBC.AX,Type=0,Price=34.44,Size=64,Source=42,Condition=?,Tick=?,Mmid=A,SubMarketId=

For more information, see the complete list of PPro8 TOS Values (Market Center, Submarket ID, and Sales Conditions).

Market Depth (L2)

Example:

Register?symbol=ZVZZT.NQ&feedtype=L2 & output=[bykey|bytype]

This command registers the API to receive all Level 2/Market Depth updates for symbol ZVZZT. These updates are then written to a file in the PPro8 launch directory with the name L2_1_ZVZZT.NQ.log.

Messages for L2 must include the symbol parameter.

L2 messages are stored in a separate file for each registered symbol.

Each L2 update is a comma-separated line of data with the following fields:

  • LocalTime=08:39:43.114 ← the time the update arrives on the user's machine and uses the user's computer's time
  • MarketTime=08:39:42.601 ← the market time of the update
  • Mmid=ANON ← the MMID (Market Maker ID) associated with the update
  • Side=B ← the side of the update
  • Price=8.6 ← the price of the update
  • Volume=100 ← the size in shares of the updated quote
  • Depth=1 ← the number of orders that make up the quote, where applicable
  • SequenceNumber=27003 ← the sequence number is unique by MMID, Price, and Side, and can be used to correct for out-of-sequence data

Each update either a) creates a new level, or b) replaces the existing values for that MMID, Price, and Side combination.

For example, if you already have an ANON Bid @ 8.60 for 400 shares, then the above example data would replace that so the new values would be ANON Bid @ 8.60 for 100 shares.

Market Depth snapshot

When the API registers for the L2 feed on a symbol, it first receives a snapshot. This snapshot represents the current quote state of the symbol, and should then be updated with the real-time messages coming in.

The snapshot begins with a line where Side=s, for example:

LocalTime=08:37:31.908,MarketTime=00:00:00.000,Mmid=,Side=s,Price=0,Volume=0,Depth=0,SequenceNumber=0

All messages making up the snapshot have SequenceNumber=0.

The snapshot ends with a line where Side=e, for example:

LocalTime=08:37:31.908,MarketTime=00:00:00.000,Mmid=,Side=e,Price=0,Volume=0,Depth=0,SequenceNumber=0

Imbalance (IMBALANCE)

Example:

Register?region=1&feedtype=IMBALANCE&output=[bykey|bytype]

This command registers the API to receive all Imbalance data. This data is then written to a file in the PPro8 launch directory with the name: IMBLO_1_ALL.log.

Messages for IMBALANCE must pass the region parameter.

Note: NASDAQ and NYSE information is dynamic, while TSX/TSX-V information is static. AMEX information is not available at this time.

Each IMBALANCE update is a comma-separated line of data with the following fields:

  • LocalTime=15:57:15.113 ← the time the update arrived on the user's machine and uses the user's computer's time
  • MarketTime=15:57:15.072 ← the market time of the update
  • Side=S ← the side of the imbalance
  • Type=O ← the type of imbalance, where applicable
  • Status= ← the status of the imbalance, if applicable
  • Symbol=LKQ.NQ ← the symbol on which the imbalance exists
  • Price=32.875 ← the price of the stock
  • Volume=3578 ← the size of the imbalance in shares
  • Mmid=Q ← the market of the imbalance (Q=NASDAQ, N=NYSE, T=Toronto, V=Venture)
  • AuctionPrice=32.84 ← the theoretical auction price, where applicable
  • ContinuousPrice=32.86 ← the continuous price on the primary market, where applicable
  • PairedVolume=67428 ← the size, in shares, already paired off

Each imbalance update represents the current size of the imbalance. Previous messages for the same symbol can be discarded.

Order Status (OSTAT)

Example:

Register?region=1&feedtype=OSTAT&output=[bytype]

This command registers the API to receive all Order Status (OSTAT) messages for the user in region 1 (NCSA), region 2 (EMEA), region 3 (APAC), or region 4 (AUNZ). This data is then written to a file in the PPro8 launch directory with the name OSTAT_1.log. The numerical value in the log file name represents the region.

Messages for OSTAT must pass the region parameter.

One file is created for each region. In order to see all order updates—including internal rejects—a user will need to monitor both the OSTAT and ORDEREVENT logs.

Note: for Futures contracts, the API sends the contract size for the Price tag, not the contract price. Use GetLv1 to find tick size and tick value, and to calculate: Contract Price = (Contract Size * Tick Size) / Tick Value

Each OSTAT update is a comma-separated line of data with the following fields:

  • LocalTime=09:35:34.237 ← the time the update arrived on the user's machine and uses the user's computer's time
  • MarketDateTime=20131011-09:35:34.048 ← the market date and time of the update
  • Currency=CAD ← the currency of the order
  • Symbol=TD ← the symbol on which the order was submitted
  • Gateway=2028 ← the Gateway ID on which the order was submitted
  • Side=B ← the side on which the order was submitted
  • OrderNumber=TESTTEST00000024M1713F3100000 ← the unique order number of the order
  • Price=92.72000000 ← the price of the order status update; for a new order it is the order price, for Fill / PartialFill it represents the price of the shares executed
  • Shares=100 ← the number of shares associated with the order status update; for a new order is it the order size, for a Fill / PartialFill it represents the number of shares executed
  • Position=2 ← a sequence number for messages related to the unique order number, for example, 1 is first, 2 is second, and so on
  • OrderState=Filled ← the status of the order represented by the update
  • MarketID=2 ← the market on which the order was submitted
  • CurrencyChargeGway=CAD ← the currency of the gateway charge
  • ChargeGway=-0.31 ← the gateway charge associated with this status update
  • CurrencyChargeAct=CAD ← the currency of the activity charge
  • ChargeAct=0.011 ← the activity charge associated with this status update
  • CurrencyChargeSec=CAD ← the currency of the SEC/Regulatory fee
  • ChargeSec=0 ← the SEC/Regulatory fee associated with this status update
  • CurrencyChargeExec=CAD ← the currency of the execution charge
  • ChargeExec=0.16 ← the execution charge associated with this status update
  • CurrencyChargeClr=CAD ← the currency of the clearing charge
  • ChargeClr=0.008 ← the clearing charge associated with this status update
  • OrderFlags=128 ← the order flags associated with the orders, used for internal processing only and to identify if the order was sent through PPro8 or the API
  • CurrencyCharge=10 ← internal value, not relevant for external analysis
  • Account=1TESTOF001TNVTESTTESTCAD1 ← the account associated with this order
  • InfoCode=255 ← internal value for tracking OSTAT codes, not relevant for external analysis
  • InfoText=LiqFlags=^Tag6888=20^Tag31=92.720^Tag9730=A ← additional information text, if any, associated with this status update

Order Flags are a sum of the below numbers:

  • ConvertToShortSell = 1
  • CancelOpposing = 2
  • SetPriceToComply = 8
  • AutoCancelOrder = 32
  • AutoCancelOnPartialFill = 64
  • SentViaPProApi = 128
  • SentViaScriptSrv = 256

SentViaScriptSrv=256 flag is sent whenever an order triggers Cancel Opposing or Cancel Less Aggressive logic.

You can use the OSTAT log, in combination with the ORDEREVENT log, to monitor the state of orders and track executions and associated fees. This data is also used by the PPro8 client software to update the Summary and History Log windows.

Order Event (ORDEREVENT)

Example:

Register?region=1&feedtype=ORDEREVENT & output=[bykey|bytype]

This command registers the API to receive all Order Event (ORDEREVENT) messages for the user in region 1 (NCSA). This data is then written to a file in the PPro8 launch directory with the name ORDEREVENT_1.log.

Messages for ORDEREVENT must pass the region parameter.

One file is created for each region. This log can be combined with the OSTAT log to monitor for all order updates.

The primary use of the ORDEREVENT log is to recognize an order as rejected internally where it does not appear in the OSTAT log.

Each ORDEREVENT update is a comma-separated line of data with the following fields:

  • LocalTime=08:39:45.442 ← the time the update arrived on the user's machine and uses the user's computer's time
  • MarketDateTime=20131025-08:39:45.208 ← the market date and time of the update
  • EventMessageType=1 ← the nature of the order event: 1 = NewOrder, 2 = CancelOrder, 3 = ManualOrderConf, 4 = OrderFlagsChange, 5 = LastOrderEventType
  • EventFlavour=2 ← the internal state of the order event: see flavour descriptions list below
  • EventOriginatorId=1 ← the originator of the order event: 1 = Client, 2 = OPC, 3 = GS, 4 = SS
  • OriginatorSeqId=0 ← the sequence number of the event sent by the originator
  • Size=100 ← the size of the order, in shares
  • Price=8610000000 ← the price at which the order was submitted; uses PPro8 native price format, which needs to be divided by 10^9 (1000000000) to show human-readable price
  • OrderNumber=TESTTEST00000003M171401100000 ← the unique number of the order
  • InfoText= ← additional information text associated with this order event, for example, the reject reason

Order_Event (ORDEREVENT) Flavour Descriptions as follows:

  • 0 NoOrderEventFlavour ← the order has no event flavour
  • 1 RequestPending - reports about a request that was made have no effect on the order state (initially Holding)
  • 2 Accepted - the order is on the market
  • 3 PartFill - the order is not open (State to Filled)
  • 4 Filled - order not open (State to Filled)
  • 5 Cancel - the order is not open (State to PartCancelled or Cancelled)
  • 6 RejectedOrderClosed - the request was rejected, and the order number requested is not/no longer open
  • 7 RejectedOrderOpen - the request was rejected, but the order is still live on the market
  • 8 RejectedNoConnection - the request was rejected due to a network issue
  • 9 CancelReplace - (State remains unchanged, either Accepted or PartFilled)
  • 10 Holding - from the PPro8 Client, the order is being held, awaiting an event before being sent (State→Holding)
  • 11 LastOrderEventFlavour - the last order event flavour

Note: when price and sizes are pending OPC, an invalid value appears. This issue is usually corrected when we release a new OSM. If you believe this can affect trading, you may be able to filter them out as Size = -1. The description will also show the message 'New order, OPC Pending'.

PProAPI Index to Order Number (PAPIORDER)

Example:

Register?region=1&feedtype=PAPIORDER&output=[bykey|bytype]

This command registers the API to receive information for orders sent through the API about the order number associated with each order request ID. The data is then written to a file in the PPro8 launch directory with the name PAPIORDER_1.log.

Messages for PAPIORDER must pass the region parameter.

You can use this log file to limit the number of 'GetOrderNumber' requests you need to submit. You can set your program/script to monitor this log file for that information.

Each PAPIORDER update is a comma-separated line of data with the following fields:

  • LocalTime=10:10:07.006 ← the time the update arrived on the user's machine and uses the user's computer's time
  • PProApiIndex=3 ← the RequestID associated with an ExecuteOrder event as returned in XML
  • OrderNumber=DV10600503000002M171407100000 ← the order number associated with the RequestID

Deregister

This command is used to deregister for available data types. This stops the API from writing to log files or making L1 calls available.

Syntax:

Deregister?symbol=symbol.extension & region=[1|2|3|4] & feedtype=[L1|TOS|L2|IMBALANCE]

Examples:

Deregister?symbol=ZVZZT.NQ&feedtype=TOS
Deregister?region=1&feedtype=IMBALANCE

Notes

  • For IMBALANCE messages, define region, not symbol
  • Regional data centers: 1 = NewJersey, 2 = London, 3 = Hong Kong, 4 = Sydney
  • For L1, L2, or TOS data, define symbol
  • 'Lv1' and 'Tos' are deprecated but still available; update your scripts to use 'L1' and 'TOS'

Lv1 & Tos

'Lv1' and 'Tos' are deprecated, but still available. Update your scripts to use 'L1' and 'TOS'.

Get

This command gets information from Summary by layer. It returns the same total number of columns as the PPro8 GUI for all layers.

Syntax:

Get?type=tool & tool=[Summary_n] & key=[^]*

Example:

Get?type=tool&tool=Summary_2&key=NCSA Equity^GODOT^F.NY

Notes

  • To determine the key, open Summary, right-click a layer, and then click Copy Key to Clipboard.
  • The output will be written as CSV in the format _.log

GetBlotterSnapshot

Use this command to request a Refresh from Summary.

Syntax:

GetBlotterSnapshot?trader=[USERID] & region=[1|2|3|4] & assetid=

Example:

GetBlotterSnapshot?trader=DV113X91&region=1&assetid=1

GetEnvironment

This command recalls the environment the user is logged into (TMS or Live), and the user ID and directory where PPro8 is installed.

Syntax:

GetEnvironment?

Return:


GetLv1

This command recalls Level 1 snapshot data. You must register for L1 data before trying to read it.

Syntax:

GetLv1?symbol=

Example:

GetLv1?symbol=TD.TO

This will bring up the following response:


This GetLv1 response is a comma-separated line of data that includes the following fields:

  • Volume=798304 ← the volume of the symbol
  • LowPrice=55.1100 ← the low price
  • HighPrice=55.5000 ← the high price
  • OpenPrice=55.4000 ← the open price
  • ClosePrice=55.3400 ← the close price
  • MaxPermittedPrice=0 ← the maximum permitted price
  • MinPermittedPrice=0 ← the minimum permitted price
  • LotSize=100 ← the lot size
  • LastPrice=55.1100 ← the last price
  • InstrumentState=Open ← the instrument state
  • AssetClass=Equity ← the asset class
  • TickValue=0 ← the tick value
  • TickSize=0.00500000 ← the tick size
  • Currency=CAD ← the currency

GetTraderInfo

This command returns information about a trader, including algorithm, LFT amount, NL amount, etc.

Syntax:

GetTraderInfo?trader= & region= & assetid=

Example:

GetTraderInfo?trader=DV113X91&region=1&assetid=1

Response:

traderId="DV113X91" regionId="1" assetclassId="1" traderState="1" algorithm="0" lftAmount="2000" netLossAmount="1500" timerIsActive="N" currentTimeRemaining="0"

This response includes the following fields:

  • traderId=DV113X91 ← the ID of the trader
  • regionId=1 ← the ID of the region
  • assetclassId=1 ← the ID of the asset class
  • traderState=1 ← the state of the trader
  • algorithm=0 ← the ID of the algorithm
  • lftAmount=2000 ← the daily Loss From Top amount
  • netLossAmount=1500 ← the daily Net Loss amount
  • timerIsActive=N ← is the risk timer active (Yes or No)
  • currentTimeRemaining=0 ← the current time remaining in the risk timer
  • Trader State
    • 1 = Active
    • 2 = Disabled not flat
    • 3 = Disabled by User
    • 6 = Closed by User
    • 7 = Closed by Risk
  • Algorithm ID
    • 2 = Loss from Top
    • 3 = Net Loss

GetTransactions

This command recalls all executions for a user ID.

Syntax:

GetTransactions?user=

Example:

GetTransactions?user=GODOT

Return:

    

Note: for Futures symbols, this command now returns Display Price instead of Contract Size.

You can use the API to interact with orders in several ways. For more detailed examples, see the PProAPI Portal (http://localhost:8080 ).

ExecuteOrder

The ExecuteOrder command includes a number of values that can be entered depending on the chosen order type:

  • symbol=
  • limitprice= (must be a positive number)
  • ordername= (use exact spelling, case, and spacing of order name)
  • shares= (must be a positive number)
  • priceadjust= (can be a positive or negative number)
  • stopprice= (must be a positive number)
  • pegdifference=
  • displaysize= (must be a positive number)
  • displayrange=
  • minexecsize= (must be a positive number)

Syntax:

ExecuteOrder?symbol= & limitprice= & ordername= & shares= & cancel=orderNumber & priceadjust= & stopprice= & pegdifference= & displaysize= & displayrange= & minexecsize=

Return:

requestId

Example:

ExecuteOrder?symbol=BB.TO&limitprice=6.90&ordername=TSX Buy SweepSOR Limit ANON DAY Reserve&shares=1000&displaysize=100

This example would send a Reserve order on the TSX with a limit price of 6.90, a size of 1000, and a display size of 100 shares.

Notes

  • The user must ensure that the required parameters are for the order type
  • By passing a cancel order, the new order will be in a Holding state until the cancel order is verified Cancelled

ExecuteBasketOrder

Use this command to send a basket order by name.

Syntax:

ExecuteBasketOrder?basketname=

Example:

ExecuteBasketOrder?basketname=basket1

ExecuteListOrder

Use this command to send orders from an order list (set using the Order List window in PPro8).

Syntax:

ExecuteListOrder?symbol=&orderlistname=&shares=

Example:

ExecuteListOrder?symbol=ZVZZT.NQ&orderlistname=myList&shares=100

CancelOrder

This command reproduces the cancel functionality.

Syntax:

CancelOrder?type=ordernumber|all|oldest|newest|closest|furthest&ordernumber=&symbol=||&side=order|bid|offer|sell|shortsell

Example:

CancelOrder?type=all&symbol=ZVZZT.NQ&side=bid

This example command sends a cancel request for all open orders on the bid side of ZVZZT.NQ.

New: options added to CancelOrder command:

  • to cancel orders on ALL symbols.
  • to cancel orders on ALL symbols from a specific market.
  • to cancel only Sell orders.
  • to cancel only Short Sell orders.

Notes

  • For type=ordernumber, only the ordernumber parameter is required
  • For all other types, side and symbol must be defined

OrderCancelReplace

This command replaces the size of a selected order. With this function, the size can only be reduced, not increased.

Syntax:

OrderCancelReplace?ordernumber= & shares=desired reduced number of shares

Example:

OrderCancelReplace?ordernumber=GODOT___03000008M1711F7000000&shares=1000

GetOrderNumber

This command retrieves the order number associated with the request ID generated by the ExecuteOrder command.

Note: with the introduction of the PAPIORDER feed type, you can also monitor the file generated by region using that command to get this data in real time rather than polling the web server.

Syntax:

GetOrderNumber?requestid=

Return:

orderNumber

Example:

GetOrderNumber?requestid=3

This command retrieves the order number for the order submitted on Request ID 3.

GetOrderState

This command retrieves the current state for a specific order.

Note: with the introduction of the OSTAT and ORDEREVENT feed types, you can also monitor the files generated by region using those commands to get this data in real time rather than polling the web server.

Syntax:

GetOrderState?ordernumber=

Return:


Example:

GetOrderState?ordernumber=GODOT03000008M1711F7000000

This example command retrieves the current order state for order number GODOT03000008M1711F7000000.

The numerical value of the order state appears. This numerical value represents one of the following:

  • 0 = eUninitialised
  • 1 = eHolding, //!< Holding (unofficial premarket—not sent to market)
  • 2 = ePending, //!< Pre Accepted/rejected (unofficial premarket—sent to market, no response yet)
  • 3 = eAccepted, //!< Accepted (open)
  • 4 = eAP, //!< Part Filled (open)
  • 5 = eAPC, //!< Part Cancelled (terminal eAP)
  • 6 = eAPF, //!< Multi Filled (terminal eAP)
  • 7 = eAF, //!< Filled (terminal eA)
  • 8 = eAC, //!< Cancelled (terminal eA)
  • 9 = eRejected, //!< Rejected
  • 10 = eJunked, //!< Junked

GetOpenOrders

Syntax:

GetOpenOrders?user=

Return:

(....)

Example:

GetOpenOrders?user=GODOT

This command retrieves the states of orders by user ID. States include the following:

  • Accepted
  • Canceled
  • Holding
  • Rejected

This command also returns the following parameters:

  • Symbol
  • Price
  • Side
  • Gateway
  • Destination
  • MarketTime

Note: for Futures symbols, this command now returns Display Price instead of Contract Size.

SendTrailingStop

This command sends a trailing stop order according to set parameters.

Syntax:

SendTrailingStop?symbol= & limitprice= & ordername= & shares= & referenceprice= & offsettype= & trailoffset= & incrementtype= & trailincrement= & priceadjust= & stopprice= & pegdifference= & displaysize= & displayrange= & minexecsize=

Example:

SendTrailingStop?symbol=_STW60.E1&limitprice=10.10&ordername=AUTE Buy AUTE Limit ANON DAY&shares=100&referenceprice=bid&offsettype=percentage&trailoffset=0.8&incrementtype=numeric&trailincrement=1

SendSwiftStop

This command sends a stop order script according to set parameters.

Syntax:

SendSwiftStop?symbol= & limitprice= & ordername= & shares= & swiftstopprice=

Example:

SendSwiftStop?symbol=_STW60.E1&limitprice=10.10&ordername=AUTE Buy AUTE Limit ANON DAY&shares=100&swiftstopprice=10.08

GetOpenPositions

 

This command retrieves a list of the current open positions for a user ID.

Syntax:

GetOpenPositions?user=

Return:

 <Symbol  />(....)

Example:

GetOpenPositions?user=GODOT

Flatten

This command will cancel all open orders for a symbol. It will also cancel all scripts on the symbol, provided that the trader has a position or an open order on the symbol.

Syntax:

Flatten?symbol=

Example:

Flatten?symbol=ZVZZT.NQ

This command can also be used for multiple symbols:

Example:

Flatten?symbol=ZVZZT.NQ,ZWZZT.NQ,ZXZZT.NQ

Notes

  • If a single symbol is given, that symbol will be flattened for the logged-in trader
  • If symbol contains a list of symbols separated by commas, all those symbols will be flattened

Get (Summary)

This command retrieves Summary data by layers. For example, Get Summary by Trader.

Syntax:

Get?type=tool&tool=&key=

Example:

Get?type=tool&tool=Summary_1&key=NCSA Equity^GODOT^F.NY

This command exports the information to a CSV file named _.log. This example retrieves information on GODOT's position in F.NY from Summary_1, which can be set up by Trader:Symbol in layer settings.

Additional Notes

  • For more information about markets currently available for trading with PProAPI, see the PProAPI Markets List.
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International

CC Attribution-Share Alike 4.0 International