**Trading -> Live Monitoring**

Every trader who has a position open right now, priced on every tick. The screen
answers three questions: who is about to hit a limit, what the firm is exposed
to while they do, and what to do about it.

You need the `view_monitoring` permission to open the screen and
`manage_monitoring` to close positions or cancel pending orders. Without it
those actions are not offered anywhere on the screen. Opening an account in
[Trading accounts](/docs/platform/admin/trading-accounts) needs `view_accounts`,
and opening the trader needs `view_traders`.

## The floor

The screen opens on the floor alone, across its whole width. Its head says
whether it is live, how many accounts and positions are on it and what they
float together, per currency. When the live connection drops it says
**Offline since** and the time, because positions opened or closed after that
only show once it is back. Two counts follow when they are not zero: accounts
near a limit and accounts with a low margin level. Each also names the ones
that need a look first, accounts with less than 10% of a limit left and
accounts below 100% margin level. Clicking either count narrows the floor to
it.

A symbol that has had no live price for ten seconds is named under the head,
with the note that its P&L is the last one the server sent. Ten seconds,
because prices arrive as they trade and a quiet instrument has not ticked yet
right after the page opens.

The floor reads three ways, picked above it:

| View      | One row per | What a row shows |
| --------- | ----------- | ---------------- |
| Accounts  | Account     | The trader, the status, the account number and challenge, the equity, the margin level with the margin in use, the positions and pending orders, the floating P&L, and the room left on its tightest loss limit |
| Positions | Position    | The symbol, side and lots, whose it is, the price now and the open price, stop loss and take profit, how long it has been open, and its P&L |
| Symbols   | Instrument  | The long and short lots across the floor, what they net to, how many positions in how many accounts, and the floating P&L per currency |

Columns drop off from the right as the screen narrows. Clicking a symbol shows
the positions in it. Right-clicking a row opens its menu: open the account
beside the floor, in Trading accounts or its trader, narrow the floor to it,
copy its number, the trader's email, its id, a link or a ticket, and the
actions under Stepping in.

The floor shows fifty rows to a page. Each view sorts one way per column, the
way somebody reads it first. Accounts start on least room left, and also sort
by deepest loss, most equity, lowest margin level, most positions or trader.
Positions start on deepest loss, and also sort by largest, longest open, symbol
or trader. Symbols start on most lots, and also sort by largest net exposure,
deepest loss or name. The filter menu and the column heads sort the same.

While the pointer is over the rows, a menu is open or J and K are walking
them, the rows keep their places even when prices move, so the row you are
about to click does not slide away. Their numbers keep moving. Three seconds
after the last J or K the floor sorts again.

## Search and filters

Search matches the trader's name and email, the account number, the challenge
and phase, the symbol, the instrument name and the ticket. Several words narrow
further: every one of them has to match. Start a word with `#` to look only at
account numbers and tickets, so `#1042` does not also find a trader whose email
contains those digits. Press `/` anywhere on the screen to jump to the search
box and `Esc` to clear it.

| Filter       | What it narrows to                                      |
| ------------ | ------------------------------------------------------- |
| Status       | Active accounts, still in evaluation, or funded ones    |
| Side         | Buy or sell positions                                   |
| P&L          | Winning or losing                                       |
| Challenge    | One or more challenges, picked from the ones on screen  |
| Symbol       | One or more instruments, picked from the ones on screen |
| Near a limit | Less than a quarter of a loss limit left                |
| Low margin   | Accounts whose margin level is under 200%               |

The search, filters, view, sort and page live in the address bar, so a view can
be bookmarked or sent to a colleague and opens exactly as you left it.

## Room to the limit

For each account the screen works out the equity at which its daily loss limit
and its maximum loss limit are hit, using the same reference points the risk
engine measures from. The room left is the live equity minus that level, shown
as an amount and a bar on the tighter of the two. Hovering over it shows both.
The bar turns red once less than a tenth is left, and the amount once the
limit is crossed. An account whose phase sets no loss limit shows **No limit**.

The margin level turns red below 100%, where a margin call starts. A level
above 1,000% shows as **Over 1,000%**: past that point it only says the
positions are small next to the account.

## An account

Picking an account, or a position, folds the floor to a column on the left and
slides the account in beside it. The cross in the corner or Escape folds it
away and gives the floor its width back, with the same search, filters and
page. J and K move through the rows and Enter opens the one they rest on. Once
an account is open, J and K show each account they rest on.

Every account has its own address, `/admin/monitoring/acct_...`, and the tab
you have open is part of it.

The head of an account names its challenge, size and phase and the trader it
belongs to, and says when that trader cannot sign in, was deleted, is on your
team, is restricted by fraud detection or has open flags. Under it are the
notes a colleague pinned on the account in Trading accounts. Then the figures
that move with every tick: the equity with the balance, the floating P&L, the
margin level with the free margin, the room left on the daily and the maximum
loss limit, and what the account closed today.

| Tab       | What it holds |
| --------- | ------------- |
| Positions | Every open position valued at the price it would close at, with your spread on top, its stops and how long it has been open |
| Orders    | The pending orders: buy or sell, limit or stop, the price they wait for, their stops, when they were placed and when they expire. Read again every ten seconds while the tab is open, because pending orders are not on the live connection |
| Today     | The trades closed since the risk engine's day began, newest first and up to 200, with why each closed and what it made after commission. The day starts at midnight on the server's clock, when the daily loss limit starts over, and the tab says when that was in your own time |

The menu in the head opens the account in Trading accounts or the trader,
narrows the floor to the account, and copies its number, the trader's email,
its id or a link to it.

## Stepping in

Every action asks for confirmation first. A close acts at the current market
price.

- **Close** on a position closes it whole.
- **Close part** asks how many lots. It has to be at least the instrument's
  smallest lot and a whole number of its lot steps, and what stays open has to
  be at least the smallest lot as well, so a position of one smallest lot can
  only close whole. The dialog shows what stays open and what the closed part
  makes at the live price. The rest keeps its ticket, and the part that closed
  becomes a closed trade of its own.
- **Close all positions** closes everything on the account and checks the
  account against its rules once at the end. Pending orders stay in place, and
  the confirmation says how many there are.
- **Cancel** on a pending order, or **Cancel pending orders** for all of them,
  takes them away so they cannot fill. Open positions stay as they are.

The trader gets a notification for each of these, saying risk management did
it, and their journal names risk management as the reason a trade closed.
Every action is in the activity log with who did it. When the position closed
by itself while the confirmation was open, the screen says it was already
closed. When a pending order filled first, it says the order could not be
cancelled and that its position is open now.

## In the older designs

Propper - OG and Tactical keep the classic screen: one table with an accounts
and a positions view, a side panel with what needs attention, the accounts
closest to a limit and the net lots per symbol, and closing a position or a
whole account from the right-click menus. The Symbols view, an account beside
the floor with its pending orders and today's trades, closing part of a
position and cancelling pending orders are only in the standard design. A link
to an account on this screen opens the classic floor searched for that
account's number.