Skip to Content
NeurotraderDocs
Concepts

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.

Screenshot
The journal beneath the charts of a run's page in the Orders view, with the Orders, Trades and Account toggle, the status filter, the In view toggle and rows of buy and sell orders with their type, quantity, price, status and cause

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.

FieldMeaning
TimeWhen the order was placed, in market time.
SideBuy or Sell.
TypeThe order type. See Order types.
LeverageThe leverage the order asked for. Shown for a margin account.
QuantityThe amount ordered, in the instrument's base asset.
FilledThe amount that traded.
PriceThe price the order named: its limit price, or its trigger price if it has no limit. Empty for a market order.
Avg fillThe average price the order traded at.
StatusWhere the order stands. See Statuses.
CauseWhy 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.

TypeBehaviour
MarketTrades at once, at the market's price.
LimitTrades at its limit price or better. Waits on the book until the market reaches the price.
Stop marketWaits until the market reaches its trigger price, then trades as a market order.
Stop limitWaits until the market reaches its trigger price, then places a limit order.
Take profitCloses a position when the price moves in its favour to the trigger price.
Stop lossCloses 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

StatusMeaning
PendingThe order has been placed and waits to be worked.
OpenThe order is waiting on the book.
TriggeredA stop, take profit or stop loss fired and handed over to a new order.
Partially filledPart of the quantity has traded.
FilledThe whole quantity has traded.
CancelledThe order was cancelled before it traded in full.
RejectedThe account refused the order.
ExpiredThe 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:

CauseMeaning
SubmittedThe algorithm placed the order.
RestedThe order went onto the book to wait.
TradedThe order traded.
Trigger firedThe market reached the order's trigger price.
Trigger childThe order was created by a trigger that fired.
Insufficient collateralThe account did not hold enough to cover the order.
Insufficient marginThe loan the order needed would exceed what its leverage allows.
Leverage not offeredThe order asked for a leverage level the simulation does not offer.
Invalid quantityThe quantity was not a usable amount.
Unknown tickerThe order named an instrument the simulation does not have.
Time in force expiredThe order's time in force ran out.
Unfilled on arrivalThe order had to trade at once and could not.
Parent diedThe order belonged to an order that was cancelled or rejected.
OCO alternative tradedThe other order of its pair traded.
Cancel requestedThe algorithm cancelled the order.
Close requestedThe algorithm asked to close the position.
LiquidatedThe order was cancelled because the margin account was liquidated.
Liquidation unwindThe 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.

FieldMeaning
OpenedWhen the round trip began.
ClosedWhen its last part was sold.
HeldThe market time between the two.
QuantityThe amount traded.
CostWhat the purchase cost.
ProceedsWhat the sales brought in.
PnLThe profit or loss, after fees.
Closing fillsThe 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.

On this page