Execution journal
The record of every order an algorithm placed in a run: the fields of an entry, the order types and statuses, and how the journal follows the charts.
A net worth chart shows what a run came to. It does not show what the algorithm did to get there. The execution journal does: it lists every order the algorithm placed, with what the account did about each one, so you can follow a run decision by decision and see why it went the way it did.
The journal on a run's page
The journal is the table beneath the charts on a run's page. It follows the selection above it: it shows the orders of the algorithm chosen in the algorithm picker, on the instrument shown in the candle chart.
The journal has three views:
- Orders: every order the algorithm placed.
- Trades: the round trips those orders closed, with the profit or loss of each.
- Account: the events of a margin account, such as loans and interest. See Margin and leverage.
The journal, the charts and the overview strip work as one instrument. Select a row and the charts move to that order. Select an order's mark on the candle chart and the journal selects its row.
One entry per order
The Orders view has one row per order, whatever became of it. Filled, rejected, cancelled and still-open orders are all listed. An order that was refused is as much a part of the story as one that traded: an algorithm that keeps asking for what it cannot afford shows up here as a column of rejected orders.
| Field | Meaning |
|---|---|
| Time | When the order was placed, in market time. |
| Side | Buy or Sell. |
| Type | The order type. See Order types. |
| Leverage | The leverage the order asked for. Shown for a margin account. |
| Quantity | The amount ordered, in the instrument's base asset. |
| Filled | The amount that traded. |
| Price | The price the order named: its limit price, or its trigger price if it has no limit. Empty for a market order. |
| Avg fill | The average price the order traded at. |
| Status | Where the order stands. See Statuses. |
| Cause | Why the order has that status. See Causes. |
The caption under the table says what you are looking at, for example "Every order placed on BTCUSDT" or "12 of 240 orders on BTCUSDT, in view".
Order types
The simulated account accepts six types of order.
| Type | Behaviour |
|---|---|
| Market | Trades at once, at the market's price. |
| Limit | Trades at its limit price or better. Waits on the book until the market reaches the price. |
| Stop market | Waits until the market reaches its trigger price, then trades as a market order. |
| Stop limit | Waits until the market reaches its trigger price, then places a limit order. |
| Take profit | Closes a position when the price moves in its favour to the trigger price. |
| Stop loss | Closes a position when the price moves against it to the trigger price. |
Take-profit and stop-loss pairs. An algorithm can attach a take profit and a stop loss to an entry, as a bracket around the position. The two are alternatives: when one of them trades, the other is cancelled, and its row shows the cause OCO alternative traded.
Triggered orders. When a stop, a take profit or a stop loss fires, the order itself becomes Triggered, and a new order carries out the trade. The new order has its own row with the cause Trigger child. One decision of the algorithm can therefore appear as two rows.
Orders are not amended. To move a waiting order, an algorithm cancels it and places a new one. A trailing stop appears in the journal as a series of cancelled orders and their replacements.
Rules of the simulated account
Two rules explain most of what you see in the journal.
- An order trades on a later candle. An algorithm decides after a candle has closed, and its order is worked against the next candle. A market order placed on the 10:00 candle fills at the open of the 11:00 candle. This is the no-look-ahead rule, and it is why a fill price differs from the close the algorithm saw.
- A candle hides the order of events inside it. A candle records its open, high, low and close, not the path between them. When one candle reaches both the take profit and the stop loss of a bracket, the data cannot say which came first. Neurotrader decides by a fair draw. It does not pick the outcome that flatters the strategy. The draw comes from the run's seed, so the same run repeated gives the same result.
Statuses
| Status | Meaning |
|---|---|
| Pending | The order has been placed and waits to be worked. |
| Open | The order is waiting on the book. |
| Triggered | A stop, take profit or stop loss fired and handed over to a new order. |
| Partially filled | Part of the quantity has traded. |
| Filled | The whole quantity has traded. |
| Cancelled | The order was cancelled before it traded in full. |
| Rejected | The account refused the order. |
| Expired | The order's time in force ran out. |
Pending, Open and Partially filled are live states: such an order can still trade. The others are final. The status filter above the table offers the statuses that occur in the run, and you can select several.
Causes
The cause says why an order is where it is. The common ones:
| Cause | Meaning |
|---|---|
| Submitted | The algorithm placed the order. |
| Rested | The order went onto the book to wait. |
| Traded | The order traded. |
| Trigger fired | The market reached the order's trigger price. |
| Trigger child | The order was created by a trigger that fired. |
| Insufficient collateral | The account did not hold enough to cover the order. |
| Insufficient margin | The loan the order needed would exceed what its leverage allows. |
| Leverage not offered | The order asked for a leverage level the simulation does not offer. |
| Invalid quantity | The quantity was not a usable amount. |
| Unknown ticker | The order named an instrument the simulation does not have. |
| Time in force expired | The order's time in force ran out. |
| Unfilled on arrival | The order had to trade at once and could not. |
| Parent died | The order belonged to an order that was cancelled or rejected. |
| OCO alternative traded | The other order of its pair traded. |
| Cancel requested | The algorithm cancelled the order. |
| Close requested | The algorithm asked to close the position. |
| Liquidated | The order was cancelled because the margin account was liquidated. |
| Liquidation unwind | The account placed the order itself to close a liquidated position. |
Orders with the cause Liquidation unwind were not the algorithm's decision. The account placed them. See Margin and leverage.
Trades view
The Trades view lists the round trips the run closed on the instrument: a quantity bought and later sold completely.
| Field | Meaning |
|---|---|
| Opened | When the round trip began. |
| Closed | When its last part was sold. |
| Held | The market time between the two. |
| Quantity | The amount traded. |
| Cost | What the purchase cost. |
| Proceeds | What the sales brought in. |
| PnL | The profit or loss, after fees. |
| Closing fills | The number of fills that closed the trip. |
Selecting a trade moves the charts to the order that opened it. When the run sold assets it held from the start, the caption says how much was sold from the opening balance without a matching purchase. For the figures built from these rows, see Results.
In view
A long run has thousands of orders, and you usually care about the ones in the stretch of the run you are looking at. The In view toggle narrows the journal to the time window the charts show.
- It follows the zoom. Zoom or pan the charts, and the journal keeps to the orders inside the window. The caption ends with "in view".
- An order is in view where it was placed. The window is matched against the time the order was placed, whatever became of it later. A limit order placed inside the window and filled after it is listed. A trade is in view where it was opened.
- It needs a zoom. While the charts show the whole loaded range, there is no window to narrow to, and the toggle is disabled.
In the Account view the same toggle narrows the events.
The table shows 25, 50 or 100 rows a page. The status filter, the view and In view all apply before paging, so the page count is that of the rows you asked for.
Live runs and the API
A live run's journal fills in as the run goes: each step adds the orders it placed and updates the ones that traded.
In the API, a finished run's orders and round trips come from
get_run_actions, and a live run's
from get_live_actions. The account
events come from
get_run_account and
get_live_account.
Related
- Results: the figures the journal explains
- Charts: the charts the journal follows
- Run results
- Fees
- Margin and leverage
Results
The figures a run reports: return, net worth, peak, maximum drawdown, win rate, orders and fees, and how a comparison run presents them.
Margin and leverage
Borrowing on a simulated account: the margin terms you set, loans and interest, the margin level, margin calls, liquidation and the account journal.