#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ prop-rules-test-v1.py - The Chart Whisperer, 8 November 2026 https://chartwhisperer.ca/prop-firm-statistics#swing-test Published as https://chartwhisperer.ca/data/prop-rules-test-v1.txt so it opens in a browser. Save it as prop-rules-test-v1.py to run it. What it does Runs the published CAP backtest ledgers through two sets of prop firm evaluation rules and reports how long a pass takes, how often the loss limits are hit, and how often one day's profit dominates the total. This is a BACKTEST of S and A grade setups, after all costs. The ledgers are modelled versions of Charles's directional calls, not account statements. Direction is Charles's call; the same entry with a mechanical direction showed no edge. Past performance does not guarantee future results. Method and caveats: https://chartwhisperer.ca/protocol-results Data The four public ledgers (download them first, or pass a folder that has them): https://chartwhisperer.ca/data/cap-backtest-btc-trades-v1.csv https://chartwhisperer.ca/data/cap-backtest-eth-trades-v1.csv https://chartwhisperer.ca/data/cap-backtest-sol-trades-v1.csv https://chartwhisperer.ca/data/cap-backtest-link-trades-v1.csv Usage python3 prop-rules-test-v1.py [folder-with-the-csvs] (Python 3 stdlib only) python3 prop-rules-test-v1.py [folder] --wrong 0.5 (stress test, see 8.) Method (all choices are deliberate and stated) 1. One position at a time, per coin and per modelled version: a trade is taken only if the previous taken trade has closed. 2. A challenge is started on the entry of every taken trade, so every starting date in the ledger is tested. Starts overlap, so the runs are NOT independent samples. 3. Risk per trade is a fixed share of the starting balance (0.5%, 1%, 2%). Each trade adds result_R x risk to the balance when it closes. 4. Harsh floating-loss assumption: every winning trade is assumed to have dipped to its stop (1.03R including costs) before it won. Losing trades count at their real result. A run fails if balance plus that worst case touches the maximum-loss floor, or if one trade's worst case reaches the daily loss limit (one position at a time means one trade is the most that can be open on any day). 5. A phase passes when a trade closes with the balance at or above the target AND at least the minimum number of trading days (days on which a trade was opened) has been reached. 6. Two-step rules: Phase 2 starts on the next trade after Phase 1 passes, from a fresh balance. Runs still open when the ledger ends are excluded. 7. Best-day share: at the moment Phase 1 passes, the largest single day's closed profit divided by the total profit. 8. Wrong-call stress test (--wrong p): each taken trade is replaced, with probability p, by a full stop-out of -1.03R, as if the direction call had been wrong. 20 random draws (seed 7); the average is reported. Rules used (as published by the firms; check the current rules before buying) FTMO 2-Step ftmo.com/en/trading-objectives (page modified 2 Nov 2026): 10% then 5% targets, 5% maximum daily loss, 10% static maximum loss, 4 trading days in each phase, no consistency rule in the 2-Step. HyroTrader One-Step hyrotrader.com (homepage rules, read 8 Nov 2026): 10% target, 4% daily drawdown, 8% maximum loss, 3 trading days, "40% per day" profit distribution. Its homepage does not say whether the limits are static or trailing; they are modelled here as static. Not modelled: CFD swaps and spreads (the ledger carries perpetual-futures costs and funding), intraday trailing drawdown variants, inactivity rules, platform outages, and anything about a live trader's execution. """ import csv, os, sys, random, statistics, datetime as dt COINS = ("btc", "eth", "sol", "link") RULES = { "FTMO 2-Step": {"targets": (0.10, 0.05), "daily": 0.05, "maxloss": 0.10, "days": 4}, "HyroTrader One-Step": {"targets": (0.10,), "daily": 0.04, "maxloss": 0.08, "days": 3}, } RISKS = (0.005, 0.01, 0.02) WINNER_DIP_R = 1.03 def parse_time(s): return dt.datetime.strptime(s.strip()[:16], "%Y-%m-%d %H:%M") def read_ledgers(folder): trades = [] for coin in COINS: path = os.path.join(folder, "cap-backtest-%s-trades-v1.csv" % coin) with open(path, newline="", encoding="utf-8-sig") as f: for row in csv.DictReader(f): trades.append({ "coin": row["coin"], "version": int(row["version"]), "entry": parse_time(row["entry_candle_utc"]), "exit": parse_time(row["exit_candle_utc"]), "R": float(row["result_R"]), }) return trades def sequences(trades): """One position at a time, per coin and version.""" groups = {} for t in trades: groups.setdefault((t["coin"], t["version"]), []).append(t) out = {} for key, ts in groups.items(): ts.sort(key=lambda t: t["entry"]) taken, busy_until = [], None for t in ts: if busy_until is None or t["entry"] >= busy_until: taken.append(t) busy_until = t["exit"] out[key] = taken return out def one_phase(seq, start, risk, target, rule): balance, open_days, day_profit = 0.0, set(), {} for k in range(start, len(seq)): t = seq[k] open_days.add(t["entry"].date()) worst = t["R"] * risk if t["R"] < 0 else -WINNER_DIP_R * risk if -worst >= rule["daily"]: return "fail", k + 1, t["exit"], None if balance + worst <= -rule["maxloss"]: return "fail", k + 1, t["exit"], None balance += t["R"] * risk d = t["exit"].date() day_profit[d] = day_profit.get(d, 0.0) + t["R"] * risk if balance >= target and len(open_days) >= rule["days"]: best_share = max(day_profit.values()) / balance return "pass", k + 1, t["exit"], {"trades": k + 1 - start, "best_share": best_share} return "open", len(seq), None, None def run(seqs, rule, risk): passed, failed, days_to_funded, first_phase = 0, 0, [], [] for seq in seqs.values(): for i in range(len(seq)): k, status, end, info = i, None, None, None for n, target in enumerate(rule["targets"]): if k >= len(seq): status = "open" break status, k, end, inf = one_phase(seq, k, risk, target, rule) if n == 0 and status == "pass": first_phase.append(inf) if status != "pass": break if status == "pass": passed += 1 days_to_funded.append((end - seq[i]["entry"]).days) elif status == "fail": failed += 1 return passed, failed, days_to_funded, first_phase def quartiles(xs): xs = sorted(xs) return xs[len(xs) // 4], statistics.median(xs), xs[(3 * len(xs)) // 4] def stress(seqs, rule, risk, wrong, draws=20, seed=7): rnd, rates = random.Random(seed), [] for _ in range(draws): hit = {key: [dict(t, R=(-WINNER_DIP_R if rnd.random() < wrong else t["R"])) for t in seq] for key, seq in seqs.items()} p, f, _, _ = run(hit, rule, risk) rates.append(100.0 * f / (p + f)) return statistics.mean(rates), min(rates), max(rates) def main(): args = [a for a in sys.argv[1:]] wrong = None if "--wrong" in args: i = args.index("--wrong") wrong = float(args[i + 1]) del args[i:i + 2] folder = args[0] if args else "." seqs = sequences(read_ledgers(folder)) if wrong is not None: for name, rule in RULES.items(): for risk in RISKS: m, lo, hi = stress(seqs, rule, risk, wrong) print("%-20s risk %.1f%% %.0f%% of calls made full stop-outs: failed %.1f%% of resolved runs (range %.1f-%.1f)" % (name, risk * 100, wrong * 100, m, lo, hi)) return print("One position at a time: %d trades in %d coin-version sequences" % (sum(len(s) for s in seqs.values()), len(seqs))) for name, rule in RULES.items(): for risk in RISKS: p, f, d, fp = run(seqs, rule, risk) q1, med, q3 = quartiles(d) over40 = 100.0 * sum(x["best_share"] > 0.40 for x in fp) / len(fp) over50 = 100.0 * sum(x["best_share"] > 0.50 for x in fp) / len(fp) print("%-20s risk %.1f%% resolved %d failed %d (%.1f%%) days to funded median %d (IQR %d-%d)" " trades to first target median %g best day >40%% of profit %.1f%% >50%% %.1f%%" % (name, risk * 100, p + f, f, 100.0 * f / (p + f), med, q1, q3, statistics.median(x["trades"] for x in fp), over40, over50)) if __name__ == "__main__": main()