Run the backtest with the firm's account size and your real costs, then replay the closed trades day by day through the firm's rules. A strategy can be profitable and still fail a challenge: one bad day past the daily loss limit, or a drawdown that touches a trailing limit, ends the account whatever the total P&L. So the question to test is whether the strategy passes, which is a different question from whether it makes money.
The rules a challenge is judged on
Most evaluation and funded accounts are judged on some of these:
- Daily loss limit. The most the account may lose in one trading day. The firm sets the time the day resets.
- Maximum loss. The most the balance may fall from the starting balance, at a fixed level.
- Trailing drawdown. A maximum loss that follows the highest balance up, so the floor rises as the account makes money.
- Profit target. The gain that passes the challenge.
- Minimum trading days. How many days the account must trade before it can pass.
- Flat by the close. Some accounts must hold no position at the end of the session.
Firms count some of these on the closed balance and some on open equity, and they change the details often. Take the numbers from your firm's current rules page.
Why a summary report is not enough
A total net P&L and a maximum drawdown for the whole run cannot answer a daily rule. Two things decide a pass or fail:
- P&L by trading day. You need every closed trade with its close time, grouped by the firm's trading day.
- Which level a bar hit first. On a bar that reaches both your target and your stop, the open, high, low and close do not say which came first. That decides whether a day ended in profit or past the limit. Reamer Research settles it on a seeded tick path inside each bar, the same way on every run.
A worked example in Python
The strategy sizes each entry so its stop loses at most 150, well under the daily limit, and is flat before the close. check_rules replays the closed trades through a 50,000 account's rules.
import datetime as dt
import reamer_research as rr
RISK_PER_TRADE = 150.0 # loss at the stop, well under the daily limit
FLAT_BY = dt.time(15, 50) # be flat before the session closes
class Breakout:
lookback = 20
def on_bar(self, data):
t = dt.datetime.fromtimestamp(int(data.ts), dt.timezone.utc).time()
if data.position() != 0:
return rr.close_all() if t >= FLAT_BY else None
if t >= FLAT_BY:
return None
high, low, close = data.high, data.low, data.close
if close[-1] > high[:-1].max():
stop = low[-10:].min()
qty = round(RISK_PER_TRADE / (close[-1] - stop))
if qty > 0:
return rr.buy_market(qty, stop_loss=stop,
take_profit=close[-1] + 2 * (close[-1] - stop))
def check_rules(result, start_balance, daily_loss, max_loss, trailing,
profit_target, min_days, reset_hour_utc=0):
"""Replay the closed trades through a prop firm's rules, by trading day."""
days = {}
for t in result.closed_trades:
ts = dt.datetime.strptime(t['close_timestamp'], '%Y-%m-%d %H:%M:%S')
day = (ts - dt.timedelta(hours=reset_hour_utc)).date()
days[day] = days.get(day, 0.0) + t['net_pnl']
balance = peak = start_balance
for n, (day, pnl) in enumerate(sorted(days.items()), 1):
if pnl <= -daily_loss:
return f'failed on {day}: lost {-pnl:.2f} in one day'
balance += pnl
peak = max(peak, balance)
floor = (peak if trailing else start_balance) - max_loss
if balance <= floor:
return f'failed on {day}: balance {balance:.2f} below {floor:.2f}'
if balance - start_balance >= profit_target and n >= min_days:
return f'passed on {day}, trading day {n}: balance {balance:.2f}'
return f'not passed yet: balance {balance:.2f} after {len(days)} trading days'
result = rr.backtest(Breakout, 'SAMPLE_5min.csv', initial_capital=50_000,
commission_per_unit=0.005, spread=0.01, rng_seed=7)
print(result.closed_trades_count, 'trades, net', round(result.net_pnl, 2))
print(check_rules(result, start_balance=50_000, daily_loss=1_000,
max_loss=2_000, trailing=True, profit_target=3_000,
min_days=5))
On the kit's synthetic SAMPLE_5min.csv this prints 25 trades, net 747.74 and not passed yet: balance 50747.74 after 18 trading days, and it prints the same two lines on every run. Set reset_hour_utc to the hour your firm's trading day starts, and trailing=False for a fixed maximum loss.
More strategies in the same shape, with stop and target brackets, limit entries, risk-based sizing and several tickers, and loaders for CSV, .bin, Parquet, Alpaca and Databento bars, are in the Reamer Research examples repository on GitHub under the MIT licence, in Python, with C++ versions of the core examples.
check_rules works on the closed balance. For a rule your firm counts on open equity, the stop on every entry bounds the open loss, and data.position_state()['unrealized_pnl'] gives the open P&L on each bar if you want the strategy to flatten at a level of its own.
Checking that a pass is not luck
A challenge is a short window, so one pass on one stretch of data says little. Run the same check over many start dates, and on bars you have not tuned on. Reamer Research's Monte Carlo resamples a run's per-trade returns and reports loss and maximum-drawdown percentiles, seeded and reproducible, which shows how often the same trades would have touched the limit in a different order.
Taking it to the account
The orders the strategy returns in a backtest are the orders the relay sends live, to your broker through the open-source receiver, where you swap its paper broker for your platform's API calls. Firms set their own rules on automated trading, so check them first. For example, as of November 2026 Topstep allows custom automated strategies through the TopstepX API, a REST and WebSocket API billed separately, provided orders are placed from your own device, outside high-frequency trading, and on its simulated accounts. Reamer Research runs on your own machine, on Linux, macOS, or Windows through WSL2.
Reamer Research costs $20 per seat per month, cancel any time. The free download runs in Evaluation Mode, one ticker over up to 30 days of bars, which is enough to run this example.