The Replace Order Request
The purpose of this functionality is to provide the client, a way to replace QST orders via Excel.
The reqReplaceOrder format
reqReplaceOrder( Provider | Account | OrderId | Instrument | Side | Quantity | OrderType | Price | LimitPrice | Lifetime | ConfirmationType )
The standard call of the RTD function which uses reqReplaceOrder:
=RTD(“qst.rtd”, “”, “reqReplaceOrder( Provider | Account | Instrument | Side | Quantity | OrderType | Price | LimitPrice | Lifetime | ConfirmationType )”)
The reqReplaceOrder parameters are explained below:
Provider – the order entry provider, ex. PTS, QOR
Account – account on which the order will be placed (QST needs to be connected to this account)
OrderId – the id of the order to be replaced
Instrument – the QST instrument symbol, ex. ZCZ22
Side – side of the order: BUY or SELL
Quantity – order quantity
OrderType – QST order type, ex. LIMIT, MKT, STOP
Price – QST instrument price
LimitPrice – the limit price when placing STWL orders
Lifetime – order lifetime, ex. Day, GTC; for GTD, the expiration date should be included, the GTD format is “GTD(mm/dd/yyyy)”
ConfirmationType – if this parameter is missing or if the value is set to OFF, it will try to replace the order immediately, provided that the instrument doesn’t have restrictions for trading from algorithms that are market dependent; If the value is ON then an order cancel-replace preview dialog is triggered in QST
Note
The order of these parameters is mandatory, ex. Parameter 1, Provider, cannot be switched with parameter 2, Account.
Examples of reqReplaceOrder requests
After selecting any desired cell from the Excel spreadsheet, copy paste the RTD function in the formula bar, having replaced the RTD parameters accordingly.
Replacing a Buy 2 ZCZ22 @719^6 LIMIT, Day with order id 3451663 with Buy 1 ZCZ22 @719^2 LIMIT, Day on account 886:
*reqReplaceOrder( PTS | 886 | 3451663 | ZCZ22 | Buy | 1 | LIMIT | 7192 | | Day | )*
Replacing a GTD order with expiration date June 8th 2022, Sell 1 BRNU22 @100.25 STOP and order id 3451739, with a GTD order expiring on May 31st 2022, Sell 3 BRNU22 @100.15 STOP, with confirmation ON:
*reqReplaceOrder( PTS | 886 | 3451739 | BRNU22 | Sell | 3 | STOP | 100.15 | | GTD(05/31/2022) | ON )*
Replacing an GTC order, Buy 10 ZMU22 @392.3 STWL 390.4 and order id 3451773 with Buy 5 ZMU22 @392.7 STWL 390.1:
*reqReplaceOrder( PTS | 886 | 3451773 | ZMU22 | Buy | 5 | STWL | 392.7 | 390.1 | GTC | )*
|
Note
When using legacy prices, the “^” character needs to be omitted in the RTD command; the price 719^2 is sent as 7192 via the placeOrder command.