TradeMirror עברית

How we calculate

All money math uses exact decimals, never floating point. Times are stored in UTC and shown in your time zone.

FIFO matching

Per pair, each sell closes against the oldest open buys. Each match is a closed lot:

pnl = qty × (exit − entry) − fees

Buy and sell fees are pro-rated by quantity. A sell with no prior buy is recorded as orphan_sell and excluded.

USD value

Stablecoins (USDT/USDC/FDUSD/BUSD) = $1. Other quote assets and fee assets (e.g. BNB) use the public Binance 1-minute kline close (cached). Offline — the amount is marked as an estimate.

Equity proxy E (approximation)

The CSV has no balances, so: for each day in the last 30 days — open positions at cost + "estimated cash" = the largest entry in the window. E = the median. You can enter your account size manually on the scan page.

Minimum data

Fewer than 20 closed lots — every check returns insufficient_data. We never invent findings.

Total Cost of Behavior (TCB)

Sum of detector costs with de-duplication: each closed lot is counted once, in the detector with the highest total cost.

Discipline Score

score = 100 − min(100, 100 × TCB / max(volume × 1%, |sum of losses|))

Rounded to an integer.

Performance metrics

win rate = wins / lots   (pnl > 0 = win)
avg win = Σ pnl⁺ / wins ;  avg loss = Σ pnl⁻ / losses
expectancy = Σ pnl / lots ;  payoff = avg win / |avg loss|
avg hold = mean(exit − entry)
max drawdown = max(peak − equity), equity = Σ pnl by exit time, peak from 0
fees = Σ fees (USD)

Zero losses: payoff = "—". No lots: every metric is "—".

Trend, pairs, compare

A lot belongs to the month / ISO week (Monday start) of its exit time in your time zone. Period score = the same score formula on that period's lots, using their de-duplicated cost. Compare periods = the same metrics over two ranges.

Calculators

position: qty = (account × risk%) / (|entry − stop| + fee% × (entry + stop))
R/R: risk = |e − s| + f(e + s) ; reward = |x − e| − f(e + x)
break-even win rate = risk / (risk + reward)
fee impact = trades × size × fee% × 2

Pure calculators: nothing is stored or sent.

What-if simulator (hindsight)

Replays your lots in time order and skips any entry a rule would have blocked: cooldown X min after a loss, max entries per day, position cap (% of equity), daily stop after losing X% of equity. Stop: a lot's loss is capped at X% + fees — an optimistic bound, since we have no intra-trade prices. Hindsight only, not a forecast.

Failrail rules block

Built only from findings actually detected with cost > 0, sorted by cost. Each suggested value comes from your data (e.g. cap = min(2 × median entry, 10% of equity)). The total = TCB, no double counting.

Share link

A separate snapshot with a new random token (192 bits): read-only, without your journal and without delete. Revoke any time; deleting the report deletes it too.

Behaviors — formula per check