{% extends "base.html" %}{% from "_macros.html" import chart as svg_chart, empty, flash, kpi, pnl, page_head, source_note %} {% block title %}History{% endblock %} {% block content %} {# web/fantasy_routes.py history_page: the alpha's History tab (web/layout.py). Your F$, every trade by hand and by the strategy you follow, F$ through the run, and the leaderboard (fantasy/ledger.ranked: ROI x sqrt(trades)). #} {% call page_head("History", "Every trade you have made, your fantasy bucks through the run, and the leaderboard. F$ only: nothing here is real money, and no order ever reaches an exchange.") %} Trade → · Leaderboard ↓{% endcall %} {{ flash(msg) }} {% if not ready %}
Fantasy trading hasn't been set up on this site yet.
Each point is after an order, with open trades at what they cost (so a trade moves it only by its fee); the last point, marked "now", values open trades at what they would sell for now.
{% else %}{{ empty("Your F$ through the run shows here once you have traded by hand.") }}{% endif %}| Market | Side | Shares | Cost | Worth now | P&L | |
|---|---|---|---|---|---|---|
| {{ p.group_title or p.question }} {{ p.event_title or "" }} · {{ p.exchange|capitalize }} |
{{ p.side|upper }} | {{ "%g"|format(p.shares) }} | {{ "%.2f"|format(p.cost) }} | {{ "%.2f"|format(p.value) if p.value is not none else "–" }} | {{ pnl(p.pnl) }} | Sell |
| Market | Side | Shares | Cost | Outcome | Payout | P&L | Settled |
|---|---|---|---|---|---|---|---|
| {{ p.group_title or p.question }} {{ p.event_title or "" }} · {{ p.exchange|capitalize }} |
{% if p.side %}{{ p.side|upper }}{% else %}–{% endif %} | {{ "%g"|format(p.shares) }} | {{ "%.2f"|format(p.cost) }} | {% if p.outcome is none %}{{ p.status }}{% else %}{{ "YES" if p.outcome else "NO" }}{% endif %} | {{ "%.2f"|format(p.payout) if p.payout is not none else "–" }} | {{ pnl(p.pnl) if p.pnl is not none else "–" }} | {{ p.settled_at|fmt }} |
Each share of the winning side paid F$1 when the market resolved; P&L is the payout less what the shares cost (fees are in your orders).
{% else %}{{ empty("No settled trades yet. A trade by hand shows here once its market resolves and pays out.") }}{% endif %}| When | Market | Order | Filled | Avg price | Fee | Result |
|---|---|---|---|---|---|---|
| {{ o.created_at|fmt }} | {{ o.group_title or o.question or "–" }} | {{ (o.action or "")|capitalize }} {{ "%g"|format(o.shares_req) if o.shares_req is not none }} {{ (o.side or "")|upper }}{% if o.limit_price is not none %} at {{ "%.2f"|format(o.limit_price) }}{% endif %} | {{ "%g"|format(o.shares_filled) }} | {{ "%.3f"|format(o.avg_price) if o.avg_price is not none else "–" }} | {{ "%.2f"|format(o.fee) }} | {% if o.status == 'rejected' %}refused: {{ reasons.get(o.reject_reason, o.reject_reason) }}{% else %}{{ o.status }}{% endif %} |
| Event | Kind | Subject | Side | State | P&L |
|---|---|---|---|---|---|
| {{ r.event_name or r.event_key }} | {{ r.kind|kind }} | {{ r.subject }} | {% if r.side %}{{ r.side|upper }}{% else %}–{% endif %} | {{ r.state }} | {{ pnl(r.pnl) if r.pnl is not none else "–" }} |
Paper trades the strategy made for you at the exchanges' recorded prices. Its positions, stage by stage →
{% elif profile %}{{ empty("The strategy you follow hasn't traded yet. It trades on race weekends.") }} {% else %}You don't follow a strategy. Pick one and it paper-trades for you on race weekends.
{% endif %}| # | Player | Score | ROI | Trades | P&L | By hand | Strategy |
|---|---|---|---|---|---|---|---|
| {{ r.rank if r.rank else "–" }} | {{ r.username }}{% if user and r.username == user.username %} you{% endif %} | {% if r.score is not none %}{{ "%.2f"|format(r.score) }}{% else %}–{% endif %} | {{ "%.1f%%"|format(r.roi * 100) if r.roi is not none else "–" }} | {{ r.trades }} | {{ pnl(r.pnl) }} | {{ pnl(r.manual_pnl) }} | {{ pnl(r.strategy_pnl) }} |
Score = ROI × √trades, where ROI is P&L (by hand plus strategy) over the F$ staked, and trades counts your filled orders plus the markets your strategy traded. A player needs {{ min_trades }} trades to be ranked; those with fewer are listed after, with "–" for rank. Open trades count at what they would sell for now (the best recorded bid). The demo accounts aren't listed.
{% else %}{{ empty("No players yet.") }}{% endif %}