There are numerous functions for monitoring working and filled orders. The functions include an Offset parameter. The Offset parameter for order collection formulas is an offset in the list of working or all orders, sorted chronologically:
• 1, 2, 3, ... values shall get 1st, 2nd, 3rd, ... order in the list;
• 0 shall get the last order in the list;
• -1, -2, -3, ... shall get 2nd, 3rd, 4th to last order in the list.
If the entered offset parameter is invalid (there's no order for this offset), time and price formulas shall return #N/A values, size formula shall return 0.
You can reference a cell for the value of the offset.
Fill Formulas
There are three formulas for tracking Fills. The following functions are using this formula in Cell B20:
LongStop = Exit Long = Sell EP -5 @ Stp 3084.75 DAY
Use the Offset to create a list of fills.
=FillPrice(B20)
=FillSize(B20)
The formulas are referencing cell B20, which has an Exit on a stop order. The Offset parameter (for example, FillSize(B20,-1) will report the last fill if no value is used or 0, -1 for the previous order, -2 for two orders ago, etc.
If you have multiple fills from a single order, the last fill is reported unless you use the Offset parameter. For example, below only the top order in the list is reported without using the Offset.
11/5/2019 12:46:51 PM 3 @ 3075.25
11/5/2019 12:46:51 PM 1 @ 3075.25
11/5/2019 12:46:51 PM 1 @ 3075.25
You can create a column and reference another column with the offset values.
=FillTime(B20)
Returns the time of the fills. You will need to format the cells for time values.
Number of Open Entries, Orders and Working Orders
You can track the current number of open entries. There are three formulas. Each of the following functions are using cell B20, which is a buy order: BUY1 = Buy EP 5 @ Lmt 3087.25 DAY when $C$20
=NumberOfOpenEntries(B20)
=NumberOfOrders(B20)
=NumberOfWorking(B20)
Open Entries
Three functions are available: Open Entry Price, Open Entry Size and Open Entry Time.
Returns the price of the Open position. You can use the Offset to track historical fill prices. Cell B20 is Long = Buy EP 5 @ Lmt 3094.75 DAY when $B$6.
=OpenEntryPrice()
Open Entry Size returns the size of the open entries.
=OpenEntrySize()
Open Entry Time
Returns the time of open entry fills.
=OpenEntryTime()
Order Details
The following group of functions provide details of orders. All of these use the Buy, Sell or Exit formulas and use the offset feature.
Order Average Filled Price returns the average price of a particular Buy, Sell or Exit formula.
=OrderAverageFilledPrice()
Order Filled Size returns the size of a particular Buy, Sell or Exit formula.
=OrderFilledSize()
Order Limit Price returns the Limit price.
=OrderLimitPrice()
Order Place Time returns the time an order was placed.
=OrderPlaceTime()
Order Size returns the size of an order.
=OrderSize()
Order Status reports the status of an order, such as working or filled.
=OrderStatus()
Here is a list of possible values returned:
• New: order just created, but not yet placed. It is an Internal state, unlikely to be seen in XLS Trader;
• Working: order is accepted by the exchange and not pending any action response;
• PendingPlace: place action has been sent, but there was no response, yet;
• PendingPlaceAtSessionStart" place action has been sent, but trading is not yet started, order will be placed at session start;
• PendingReplace: modification action has been sent, but there was no response yet;
• PendingCancel: cancel action has been sent, but there was no response yet;
• Failed: order is rejected, timed-out, expired or busted by FCM;
• Canceled: order is cancelled, either by user or by exchange;
• Filled: entire order size is filled.
An example of the order status of a working order.
Order Stop Price
Returns the price of a stop order.
=OrderStopPrice()
Working Order Formulas
There are four formulas for tracking working orders using this formula in cell B18:
SELL1 = Sell EP -5 @ Lmt 3086.75 DAY when $C$18
The offset parameter is 0 for the most recent order.
=WorkingLimitPrice(B18,0)
This returns the time of the placement if the working order.
=WorkingPlaceTime(B18,0)
Returns the size of the working order.
=WorkingSize(B18,0)
This function returns the price of a working stop.
The function is using this formula in Cell B20: LongStop = Exit Long = Sell EP -5 @ Stp 3085.75 DAY.
=WorkingStopPrice
Matched Trades
Here, these three functions detail matched trades. The Formula parameter uses an Exit function. Trade Profits returns "Money", "Price" or "Ticks". The default value is "Money".
Trade Size formula returns the matched size of entry and exit for a particular trade set by its Offset in the list of all trades selected by the Formula parameter.
Trade Time formula returns exit fill time for a particular trade set by its Offset in the list of all trades selected by the Formula parameter.
=TradeProfit(B26,0,"Money")
=TradeSize(B20)
=TradeTime(B26,0)