Strategy Backtest History

The Strategy Backtest History page shows a read-only report of the current strategy calculated over the current market data: the indicator chart and the trades history.

The page mirrors the market and the strategy of the Strategy Editor. It cannot modify the strategy, and it cannot change the market source. The balance chart and the backtest statistics live on the Strategy Backtest Stats page.

Layout

The page content is divided into two stacked sections by a horizontal splitter:

  • Upper section: the indicator chart.
  • Lower section: the deals and positions history table, with its own toolbar right above it.

Drag the splitter up or down to resize the upper section. The chosen height is remembered between visits.

The indicator chart

The chart draws the strategy indicators and the executed deals over the price chart of the current market. Every deal marks its bar, and the deal selected in the table is highlighted.

The Zoom in and Zoom out buttons at the right of the page toolbar re-scale the chart. They are disabled until data is loaded, and the zoom level is remembered between visits.

The chart also answers the mouse and the keyboard:

ToDo this
Zoom in or outTurn the mouse wheel, press + or -, or use the toolbar buttons
Pan the visible barsDrag the chart left or right
Scroll the chartPress the Left or Right arrow key, or PageUp / PageDown for a whole screen
Jump to the first or last barPress Home or End
Step from deal to dealPress Ctrl + Left or Ctrl + Right

Deals and positions history

The table is titled Deals and positions history in its section toolbar, which sits directly above it and also holds the paging controls. It lists every entry and exit order of the backtest. Its header names three groups of columns:

GroupColumns
DealTime, Deal, Type, Dir, Amount
PositionDir, Volume, Price, S / L, T / P
AccountProfit, Balance
ColumnMeaning
TimeOrder time with a direction icon: an entry points right, an exit points left
DealDeal number in the transaction order
Typebuy or sell side of the order
Dir (Deal)in for an entry, out for an exit
AmountThe amount of this order in the base currency, shown in thousands: 10K is 10 000
Dir (Position)The direction of the position left open after the order: an up arrow for a long, a down arrow for a short, an empty square once the order closed it
Volume (Position)The volume the position holds after the order, in the base currency and shown in thousands; empty when the position is closed
PriceFill price
S / LStop Loss level; highlighted red when it closed the deal
T / PTake Profit level; highlighted green when it closed the deal
ProfitDeal profit, colored by sign; empty for entries
BalanceAccount balance after the order

Two details are easy to misread:

  • An order closed by its stop loss or take profit is stamped at the close of its bar, three seconds before the next bar opens (…:57), while every other order carries its own time.
  • An exit repeats the stop loss and take profit levels of the entry it closed.

Selecting a deal

Click a row to select it: the row is marked active and the chart scrolls to center that order. The Up and Down arrow keys walk the selection through the rows of the current page, and opening this page from the editor's chart arrives with the first deal already selected.

Sorting by time

Click the Time column header to toggle the order:

  • Oldest (the default): earliest orders first, the first deal at the top
  • Newest: latest orders first

The Time header shows a sort arrow that reflects the current order. Changing the sort order resets paging to the first page.

Records per page and pagination

The toolbar above the table holds, from left to right:

  • The table's title, Deals and positions history.
  • Records per page: 10, 20, 30, 50, 100, 500, or 1000 records.
  • Page navigation: first, previous, next, last, and numbered pages.

Two more buttons below the table, Previous and Next, step through the pages from the table itself. They drive the same paging as the toolbar's paginator: the page they open is the page the paginator marks, and a button is disabled while there is no page before or after the current one.

The two toolbar controls are right-aligned on the title's row, the records control immediately before the page navigation.

Changing records per page resets to page 1 and refreshes the paginator.

Export

The Export button, the last control at the right of the page toolbar, downloads the trades history as a CSV file named after the market and the strategy, for example EURUSDM15-1481221368-backtest-history.csv. It is disabled until the backtest has at least one deal.

The file holds every deal of the backtest — not only the page you are looking at — in the order the table is currently sorted in. It carries the table's ten columns, with these values:

ColumnValue
TimeThe time the table shows, seconds included
DealThe deal number
Typebuy or sell
Dirin for an entry, out for an exit
AmountThe amount of the deal in the base currency: 100000 where the table shows 100K
PriceFill price rounded to the market's digits
S / LStop loss rounded to the market's digits; empty when the deal carried none
T / PTake profit rounded to the market's digits; empty when the deal carried none
ProfitDeal profit rounded to 2 decimals; empty for entries
BalanceAccount balance after the order, rounded to 2 decimals

The values are plain numbers, without currency symbols or thousands separators, so a spreadsheet reads them as numbers instead of text. An exit carries the levels of the entry it closed, exactly as the table shows them, and the amount is always positive, because the Type and Dir columns already say the side.

The file carries the table's ten deal columns. The Position group's two columns — the direction of the position after the deal and the volume it still holds — are not exported: a spreadsheet derives both from the Amount, Type and Dir columns.

Common problems

SymptomCause
The chart is empty and the table says "There is no loaded data."The market has no data for the signed-in account. A toast names the reason; the market is the Editor's, so fix it there and open the page again
Export does nothingThe button is disabled until the backtest has at least one deal. Nothing was downloaded
A price has a different number of decimals than another pageThe page prints the market's own digits: a 5-digit symbol shows five, a 3-digit one shows three
An exit shows the entry's stop loss and an odd timeThat is what happened: the exit closed the position at the level the entry set, and it is stamped at the close of its bar

Saved user preferences

The page stores user state in local storage under strategy-backtest-history-state.

Saved values:

  • Upper section height
  • Indicator chart zoom level
  • History sort order
  • History records per page

State is restored when opening the page and saved when closing it.