FAQ · Finding a tool for a specific need

How do I backtest a strategy against prop firm rules like the daily loss limit and trailing drawdown?

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: daily loss limit, maximum or trailing drawdown, profit target and minimum trading days. Reamer Research, a Python and C++ backtesting and live trading engine, gives you every closed trade with its time and net P&L, fills stops on a seeded tick path inside each bar, and repeats each run to the byte, so a pass or fail is the same every time you check it.

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:

  1. P&L by trading day. You need every closed trade with its close time, grouped by the firm's trading day.
  2. 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.

Next questions

How do I test a trading system before I risk real money or buy a prop firm challenge?Test it in steps, each of which catches a different way a system fails: a backtest with your real costs, a trade-by-trade inspection, a run on data you did not tune on, a Monte Carlo of the trade order, and paper trading at your broker with the same orders. Reamer Research, a Python and C++ backtesting and live trading engine, runs every step on your own machine, with byte-identical results, and its relay sends the orders you tested to a paper account and then a live one.How should a backtest fill a stop and a target that both fall inside one bar?Reamer Research settles it on a seeded tick path it generates inside the bar: whichever level the path touches first is the exit, the same way on every run. The bar alone cannot say which was hit first, so a backtest should settle it by one stated rule, apply that rule the same way on every run, and let you check how much the result depends on it. A strategy whose result changes when the rule changes depends on something the data does not contain.How realistic do slippage and spread need to be in a backtest?Realistic enough that the result survives them. Set spread, slippage and commission per instrument from what your broker actually charges, let spread and slippage widen when the market moves fast, and then rerun at one and a half and two times those costs. A strategy whose edge disappears under slightly higher costs was never a reliable edge.How do I know if my backtest is overfit?You cannot prove a backtest is not overfit, but you can test for the signs. An overfit result holds at one parameter set and collapses at its neighbours, fails on data it was not tuned on, rests on a handful of trades, or disappears once realistic costs are applied. Check each one, on a tool that gives the same answer every run.What is Reamer Research?Reamer Research is a deterministic backtesting and live trading engine for Python and C++, with a visual trade diagnostics tool; its relay sends live orders to your broker. You install it with pip or include one C++ header, on your own machine. It is built on a stable C ABI, so any other language that can call C can wrap it, live trading included. It tests a strategy, diagnoses it trade by trade, sweeps it, reports it, and sends its orders live, to your broker through the open-source receiver over the published protocol. Every order fills tick by tick on a seeded tick path the engine generates inside each bar, from bar data alone. Its visual trade diagnostics tool charts every closed trade on its own bars beside every value your strategy printed. The same data, settings and seed give byte-identical results every run. It costs $20 per seat per month, cancel any time.

Every answer here restates the documents that ship in the kit, which are authoritative. All questions.

Buy a licenceKey and kit by email on payment.