{% extends "journal/base.html" %} {% load static %} {% block title %}{{ trade.symbol }} — Setup Log Pro{% endblock %} {% block content %}

← Back to trades {% if prev_trade_url %} | ← Prev trade{% endif %} {% if next_trade_url %} | Next trade →{% endif %}

{{ trade.symbol }} {{ trade.direction }}

{{ trade.entry_time|date:"Y-m-d H:i:s" }} @ {{ trade.avg_entry_price }}
{% if trade.exit_time %}{{ trade.exit_time|date:"Y-m-d H:i:s" }} @ {{ trade.avg_exit_price }}{% else %}—{% endif %}
{{ trade.qty|floatformat:"-4" }}
{% if trade.pnl is not None %}${{ trade.pnl }}{% else %}—{% endif %}
{% if r_value is not None %}{{ r_value|floatformat:2 }}R{% else %}—{% endif %}
{% if trade.commission is not None %}
${{ trade.commission }}
{% endif %}
{% if trade.is_open %}OPEN {% elif effective_outcome == "WIN" %}WIN {% elif effective_outcome == "LOSS" %}LOSS {% else %}B/E{% endif %}
{% if max_move is not None %}{% if max_move_r is not None %}{{ max_move_r|floatformat:2 }}R (${{ max_move }}){% else %}${{ max_move }}{% endif %}{% else %}—{% endif %}
{% if max_pullback is not None %}{% if max_pullback_r is not None %}{{ max_pullback_r|floatformat:2 }}R (${{ max_pullback }}){% else %}${{ max_pullback }}{% endif %}{% else %}—{% endif %}
{% csrf_token %}

Chart

{% csrf_token %}
{% for indicator in chart_indicators %} {% endfor %} {% if not chart_indicators %} No moving averages configured — add some in Settings > Charts. {% endif %}
{{ chart_colors|json_script:"chart-colors" }}
{% csrf_token %} {% comment %} The browser's "default button" for implicit submission (pressing Enter in a text field) is the FIRST submit control in the form, tree order - without this, that's whichever tag chip renders first (each one IS a submit button, see remove_tag_id below), so pressing Enter after typing a new tag name silently removed an unrelated existing tag instead of just adding the new one. This invisible, harmless button (submits with no remove_tag_id at all, so the view just adds/saves normally) intercepts that instead. {% endcomment %}

Tags

{% for value, label, tags, trade_tag_ids in tags_by_category %}

{{ label }}

{# Every category can accumulate a lot of distinct values after a big import — a search-as-you-type add via beats dumping every tag as a giant chip grid. Only tags actually attached to this trade show as chips. Setup/Mistake/Custom and the comment below all share one form, so typing into several boxes and clicking Save applies all of them together. #}
{% for tag in tags %} {% if tag.id in trade_tag_ids %} {% endif %} {% empty %} No {{ label|lower }} tags yet. {% endfor %}
{% for tag in tags %}
{% endfor %}

Comment

Stop loss / target / commission

{% csrf_token %}

Fills

{% for fill in fills %} {% endfor %}
TimeSideQtyPriceRouteBrokerType
{{ fill.time|date:"H:i:s" }} {{ fill.side }} {{ fill.qty|floatformat:"-4" }} {{ fill.price }} {{ fill.route }} {{ fill.broker }} {{ fill.type }}
{% csrf_token %}

Add a fill

{% csrf_token %}

Adding an exit fill that fully or partially closes the position recalculates avg exit price, P&L, and Open/Closed automatically. If it overshoots and flips the position, a new trade is created for the remainder.

{% endblock %}