# Statistics

Source: https://tapehawk.com/docs/trade-journal/statistics

> Where your trades make and lose money, by symbol, setup, session and hour, and a P&L calendar of the days.

Open **Statistics** next to the balance on `/journal`. The page reads one account, or every account
in one currency together: the journal does not convert between currencies.

## One filter for every figure

The bar at the top picks the accounts, a range (30 days, 90 days, this year, All), a
symbol, a setup, an emotion and a side. Every block below is computed again under it, and the filter lives in the address,
so a link opens the same view.

## What counts

* **A trade counts once it is closed.** A partial exit counts on the day it was booked, even while the rest is open.
* **A day is the broker's day,** on the server clock MT5 shows, not your own. An exit at 00:30 server time belongs to that
  day even if your clock still reads the day before.
* **Sessions** (Asia, Europe, the London–New York overlap, US) are decided by when the trade was opened, with London and
  New York daylight saving applied.
* **Money is the broker's.** Net P\&L includes swap, commission and fees. It equals the journal's balance less deposits
  and withdrawals, and, in the CSV export, the `realized_pnl` of the `trade` rows that have one plus the `exit` rows of
  trades that do not (still open), leaving out trades whose `broker_gone` is `true`.
* **MT5 legs without an opening deal** (the history MT5 still had when you connected) count in net P\&L, the calendar and
  equity, but not in win rate or other per-trade figures. The page says how many there are.

## Not enough trades

A rate over a handful of trades is noise, so the page withholds it and says how many it has and how many it needs:
20 trades for a group, 10 for a cell of the weekday × hour heatmap, 30 for MAE / MFE, and 100 for SQN, Sharpe and
Sortino. Net P\&L and counts are always shown.

## The blocks

* **Overview**: net P\&L, win rate, profit factor, expectancy in money and in R, average win
  and loss, maximum drawdown, SQN, Sharpe and Sortino. Sharpe and Sortino are per trade (each result over the balance just
  before it), not annualised. Drawdown % is time-weighted, so a deposit or a withdrawal is neither a gain nor a fall.
* **Equity**: the running P\&L, with the drawdown shaded.
* **P\&L calendar**: each day's P\&L, month totals and the range total. Click a day to list what was
  booked on it.
* **Group by**: symbol, setup, emotion, side, session, weekday or hour.
* **Weekday × hour of entry**, **R distribution** with win and loss streaks, and
  **Hold time** against the result.
* **MAE / MFE**: how far each trade went against you and in your favour, in R. It needs the
  broker's one-minute bars at both the entry and the exit minute; a trade without them is left out, and the block says how
  many trades it covers.
* **Costs**: swap, commission and fees of the closed trades, and their share of the gross win.

R needs a stop. A trade without one is counted apart. When MT5 only reports the stop on the closing deal, the page counts how many
stops were read that way, since a stop may have been moved before the close.
