Strategy Backtester for Your Own Price Files
Test your own trading rules on past prices, with costs and an honest split.
Try before you buy.
- Free preview: the number of trades your rules made in full, with the first rows of each table (up to 3) and a watermarked chart; every other figure is hidden.
- Locked until you unlock it: download and copy.
- Unlock: Premium pass, ₹799 for 30 days, a one-time payment that never renews.
Ways to unlock shows how to get the full result.
Printing this result is locked in the free preview.
Your price file
The rules tested
In sample, out of sample and buy and hold
Equity
Drawdown
The trades
How this was calculated
Locked in the free preview. Opens the ways to unlock this result.
Locked in the free preview. Batch runs unlock with a pass.
Locked in the free preview. Query results unlock with a pass.
For education only, not investment advice: no tool here tells you what to buy, sell or hold. Results use only the figures you enter, the files you load (read in your browser, never uploaded) and the published rules each page names. Check them against your broker's or exchange's own figures, and consider a licensed or registered adviser for advice on your situation.
About the Strategy Backtester for Your Own Price Files
Load a price file you exported and test your own rules on it, bar by bar: entries when the close crosses a moving average, a fast average crosses a slow one, the close breaks the high or low of the bars before, the RSI crosses your level or the close passes your price — on all or any of them, on the weekdays you choose. Exits on the opposite signal, a stop (a percentage, a multiple of ATR or a price), a target (a percentage or a multiple of R), a trailing stop or a number of bars. Long, short, or both.
Orders fill at the next bar’s open by default, with your commission and slippage on every fill and sizes rounded to your market’s quantity step. Prices can be in your account’s currency, in pence (GBX) for an account in pounds, or in points with a futures contract’s multiplier. You get the trade list with each trade’s R, bars held and its adverse and favourable moves (MAE and MFE), the equity curve and drawdown, net profit, CAGR, Sharpe and Sortino ratios, win rate, payoff, expectancy, profit factor, exposure and cost drag — for an in-sample part and an out-of-sample part side by side, and against buy and hold of the same file.
The rules are white-box: you set every one. There is no optimiser and nothing that searches for “best” settings. The tool warns when the trades are too few to say much, when the out-of-sample part is much worse than the in-sample one, and when fills could look ahead. Your file is read in your browser and never uploaded.
How to use it
- From your broker, exchange or charting app, get the daily or intraday prices of one instrument as a CSV or Excel file and choose it here — or try the sample file of the fictional DEMO share.
- Check the columns panel: date, open, high, low and close, the decimal mark and the time zone.
- Set your rules: the entry conditions and how they combine, the direction, the exits, the size, the costs and the fills.
- Choose the in-sample part (for example the first 70% of the file) and read the out-of-sample part beside it, with the warnings.
- Copy the summary or download the trade list as a CSV — with a pass, or after unlocking this result. Save your rules as a file to load them again later.
Examples
Closes round(100 + 8·sin(t/2.5) + 0.15t, 4), t = 0…59, opens the previous close; long when SMA(3) crosses above SMA(6), out when it crosses below; next open; 10 units; 0.1% a side; 1,000 to start
3 trades, all winners: bar 16 at 100.0147 → bar 24 at 105.2331 (net +50.1315), bar 31 → 39 (+91.7400), bar 47 → 55 (+75.1193); net +216.9908; equity 1,050.1315, 1,141.8715, 1,216.9908
Closes round(100 + 10·sin(t/3) + 0.2t, 4), t = 0…39; 100 units; 0.1% a side
One closed trade, bar 20 at 104.3013 → bar 30 at 103.4046: gross −89.67, commission 20.7706, net −110.4406; a position opened at bar 39 at 108.6013 stays open, marked to the last close
Entry 101.00 at the open, stop 2% below (98.98), target at 2R
Target 105.04 = 101 + 2 × (101 − 98.98); a bar that reaches both is counted as stopped out
Common uses
- Check what a moving-average crossover you read about would have done on your own instrument, after costs.
- See how much commission and slippage take out of a rule that trades often.
- Compare a rule’s in-sample result with the out-of-sample part before trusting it.
- Read the drawdowns and losing streaks a rule went through, not just its profit.
The formulas
- A trade’s P&L = side × size × (exit fill − entry fill) − the commission on both fills. A fill is the price moved against you by your slippage; the size is rounded down to your quantity step.
- Stops and targets are checked against each bar’s high and low; a bar that opens beyond a level fills at its open, and when the stop and the target are both inside one bar the stop is assumed to come first. A trailing stop follows the best high (or low) since the entry and never loosens.
- R = a trade’s net P&L ÷ its initial risk (size × the distance from the entry to the stop).
- Equity is the cash plus the open position marked to each close; the drawdown is equity ÷ its running peak − 1. CAGR = (end ÷ start)^(1 ÷ years) − 1, from the file’s dates.
- Sharpe ratio = the mean of the equity’s bar-to-bar returns less the risk-free rate, ÷ their standard deviation, × √(bars a year) (Sharpe, The Journal of Portfolio Management); the Sortino ratio divides by the downside deviation instead (Sortino and van der Meer).
- Profit factor = gross wins ÷ gross losses; expectancy = the mean net P&L per trade (and in R); payoff = the average win ÷ the average loss; exposure = the share of bars with a position.
- Buy and hold puts the starting equity into the file’s first close (in fractions of a unit, with your commission both ways) and holds it to the last close.
- Overfitting: a rule tuned to one stretch of prices tends to do worse on the next (Bailey, Borwein, López de Prado and Zhu, Notices of the AMS). The out-of-sample part is a test the rules were not set on; the warning shows when its average trade return is less than half the in-sample one.
Reading the results
- Too few trades: under 30 closed trades, the figures say little — a few lucky or unlucky trades move them a lot.
- In sample against out of sample: set your rules on the in-sample part, then look at the out-of-sample part. Much worse results there are a sign the rules fit the past rather than a pattern.
- Same-bar fills (at the close of the bar that gave the signal) can look ahead: the rule reads a close that is only known when the bar ends. Fills at the next bar’s open avoid it.
- Simulated past performance (FCA COBS 4.6): these are simulated results on past prices, not a record of trades anyone made.
What it leaves out
Whatever your file does not hold: dividends, splits and corporate actions (unless the prices are adjusted), interest on cash, margin and its costs, borrowing fees for short positions, taxes, partial fills, liquidity and the price moves inside a bar. Real fills can be worse than the open, especially after gaps. Costs you do not enter are not counted.
Limitations
- One instrument and one set of rules at a time; up to 50,000 bars.
- No optimiser and no parameter search: you change a setting and run it again.
- Stops and targets inside a bar are judged from its high and low; the order of prices within a bar is not known.
- Results are simulated on past prices: they do not predict future results.
Privacy
Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.
Frequently asked questions
What do I get without a pass?
Without a pass, Strategy Backtester for Your Own Price Files shows the number of trades your rules made in full, with the first rows of each table (up to 3) and a watermarked chart; every other figure is hidden. Until you unlock it, the result can’t be downloaded or copied. A Premium or Ultimate pass, a one-time payment that never renews, unlocks the full result. The pricing page lists the passes and their prices.
Can it find the best settings for my strategy?
No. It tests the rules you set, as you set them. Searching many settings for the one that did best on past prices tends to find a fit to that history, which is why the tool has an out-of-sample part and warns when it is much worse.
Why do fills happen at the next bar’s open?
Because a rule that reads a bar’s close can only act after that bar has ended. Filling at the same close assumes you traded at a price you could not yet know; the tool lets you choose it, and flags it.
How are short trades handled?
A short position gains when the price falls: its P&L is −size × (exit − entry). In long-and-short mode the mirror image of your rule opens shorts (crosses below instead of above, the low instead of the high, an RSI level L becomes 100 − L), and a signal for the other side closes the position and opens the new one. Borrowing fees are not included.
What is the in-sample/out-of-sample split?
The file is cut in two at the share of bars or the date you choose. Trades count in the part where they started. Look at the in-sample part while you set the rules, and use the out-of-sample part as a test.
Which files can I load?
Any CSV or Excel file with a header row and date, open, high, low and close columns, including the MetaTrader 5 bars export and MetaTrader 4 history files. Without opens, orders fill at the next close; without highs and lows, stops are checked at the close.
Can I test futures, or shares priced in pence?
Yes. Under “Prices in your file”, choose pence (GBX) when the prices are in pence and your equity is in pounds, or points with a multiplier for a futures contract (50 for a contract worth 50 a point), with its lot as the quantity step. Margin, financing and the roll from one contract to the next are not counted.
Can I save my rules?
Yes: “Save rules” downloads them as a small file on your device, and “Load rules” reads it back. Nothing is kept on our server or in your browser.
Is my file uploaded?
No. It is read in your browser and nothing is sent to our server.