{% extends "journal/base.html" %} {% block title %}Simulator — Setup Log Pro{% endblock %} {% block content %}

Simulator

What-if analysis: for each rule below, simulates a spread of parameter values against your filtered trades' actual cached price data, and shows which parameters would have produced the best total R. This can run for several seconds on a large filtered set.

– {% for label, from_date, to_date in date_presets %} {% endfor %}
Clear

{{ trades_count }} trade{{ trades_count|pluralize }} match the current filter.

This report only simulates the regular trading session (9:30 AM–4:00 PM ET) — pre-market bars are excluded entirely, since there's no real Session VWAP yet before the open, and a pre-market gap can be huge in a way no resting order would realistically fill through. A trade whose own entry happens before 9:30 AM ET has no bar left to anchor to once pre-market is excluded, so it's skipped below, same as a trade with no cached chart data at all (never fetched successfully, or imported before the provider had that day's data ready). If your trade count above looks a lot higher than what the sections show, this is why. This re-fetches chart data for every trade in the current filter that's missing it — trying Yahoo Finance first, then Alpaca for older trades Yahoo no longer has (needs an Alpaca API key set on the Settings → Charts page); a fresh fetch won't help a trade whose entry the provider simply never covered, only one that was never fetched at all. It can take a while on a large filtered set.

{% csrf_token %}
{% if actual_summary %}
Realized (actual): {{ actual_summary.total_r|floatformat:2 }} total R Avg R: {{ actual_summary.avg_r|floatformat:3 }} Win rate: {{ actual_summary.win_rate|floatformat:1 }}% ({{ actual_summary.count }} trade{{ actual_summary.count|pluralize }} with a known R)

This is what actually happened with your real exits, for comparison against the simulated trailing-stop results below.

{% endif %} {% for section in sections %}

{{ section.label }}

Simulate

{{ section.description }}

{% if section.results is not None %} {% if section.results %}

"All trades" always covers the same trades as "Realized (actual)" above, falling back to your real result wherever a combo couldn't apply — that's the fair number to compare across rows, and it's what sorts and stars the best one. "This combo only" is just whichever trades it could actually simulate, which differs row to row — not safely comparable on its own.

{% for r in section.results %} {% endfor %}
Parameters All trades (fair comparison) This combo only
TradesTotal RAvg RWin % TradesTotal RAvg RWin %
{{ r.label }} {{ r.full_count }} {{ r.full_total_r|floatformat:2 }} {{ r.full_avg_r|floatformat:3 }} {{ r.full_win_rate|floatformat:1 }}% {{ r.count }} {{ r.total_r|floatformat:2 }} {{ r.avg_r|floatformat:3 }} {{ r.win_rate|floatformat:1 }}%
{% else %}

No trades in the current filter had enough data to simulate this rule.

{% endif %} {% endif %}
{% endfor %} {% endblock %}