ValidateOrder table

Table Name: Order
Supports: INSERT, UPDATE, DELETE
Permissions: Zenith/OrderPad\

Provides validation for Order Management operations for the user.

Operations submitted using this table are validated, but not executed. No order operations are performed.

INSERT/UPDATE/DELETE

Allows validation of placement, amendment, movement, or cancellation of Orders.

All operations only manipulate a single order at a time.

  • Account is required in the SET statement for INSERT, and the WHERE statement for all other operations.
  • OrderID is required in the WHERE statement for all operations except INSERT.
  • Either SymbolCode, or both Exchange and Symbol, are required during INSERT.
  • Side is required during INSERT.

Columns

Name Type Set Where Description
Account String I/U U/D The Trading Account of the Order.
BrokerageSchedule String I/U The Brokerage Schedule associated with this Order.
Class String I The style of Order, which should correspond to the Class for the associated Symbol. If omitted, defaults to Market. One of the following values:
Market.
ManagedFund.
Exchange String I The Exchange the Symbol was issued by.
Flags Array I/U/D An array of Flags for this Request.
Instructions Array I/U An array of Execution Instruction codes for this Order.
OrderID String U/D The unique identifier of the Order. Will not change for the life of the Order.
RequestID String I/U/D The unique identifier used by this Request. If omitted, a random ID will be assigned.
Route String I/U The routing algorithm for this Order.
Side String I The side of the market the Order belongs to. One of the following values:
Bid – Buy Order.
Ask – Sell Order.
StopPrice Decimal I/U The current Stop Loss price for this Order.
StopDirection String I/U The direction in which the Stop Loss price will trigger.
StopReference String I/U The reference price for triggering the Stop Loss.
Symbol String I The code assigned by the Symbol Issuer.
SymbolCode String I The combined Symbol and Exchange codes, eg: Symbol.Exchange. Not included in *.
TradingMarket String I/U The Trading Market the order is to be routed to.

The following columns apply to Orders with the Market Style:

Name Type Set Where Description
ExpiryDate DateTime I/U The expiry date of the Order. Omit to last until cancelled.
HiddenQuantity Integer I/U The number of hidden shares involved in the Order.
LimitPrice Decimal I/U The price to place the Order at. Valid for Limit only.
MinimumQuantity Integer I/U The minimum quantity to shares for this Order to execute. Only supported on some markets
Type String I The Order Type of the Order. One of the following values:
Limit.
Market.
MarketToLimit
Validity String I/U The validity criteria for the Order. One of the following values:
UntilCancel – Order exists until cancelled or the Expiry date is hit. Default if none supplied.
FillAndKill – Trades as much as possible then cancels. Also known as Immediate-or-Cancel.
FillOrKill – Trades the entire quantity immediately, or cancels.
AllOrNone – Only executes when it can trade the entire quantity. Exists until cancelled or the Expiry date is hit.
VisibleQuantity Integer I/U The number of visible shares involved in the Order.

Results

Name Type Description
Result String The result of the operation. One of the following values:
Success – Request successful.
Incomplete – Required fields are missing.
Invalid – The supplied fields are invalid.
Rejected – The order was rejected by the Exchange.
OrderID String Always null for validation
Errors Array If validation failed, supplies an array of string codes identifying the errors encountered.
EstimatedBrokerage Decimal If able to be calculated, provides the estimated brokerage this Order would incur.
EstimatedTax Decimal If able to be calculated, provides the estimated tax this Order would incur.
EstimatedValue Decimal If able to be calculated, provides the estimated value of this Order, not including Brokerage or Tax (ie: Net Consideration).

Examples

Validates placing an Order:

INSERT INTO ValidateOrder SET Symbol = 'BHP', Exchange = 'ASX', TradingMarket = 'CXA::LI', Type = 'Limit', Quantity = 100, LimitPrice = 5.01 WHERE Account = '123ABC'

Validatates amending an existing Order:

UPDATE ValidateOrder SET Quantity = 200 WHERE Account = '123ABC' AND OrderID = 'XYZ'

Validates moving an Order to a different Trading Account:

UPDATE ValidateOrder SET Account = '456DEF' WHERE Account = '123ABC' AND OrderID = 'XYZ'

Validates cancelling an Order:

DELETE FROM ValidateOrder WHERE Account = '123ABC' AND OrderID = 'XYZ'