Home / Backtest
Backtest
Would your strategy have made money?
Find out before you risk a rupee. AmiFeedX has its own backtest engine, built for Indian markets. Wire blocks like a flowchart, run it on your broker’s own data, and read an honest report. No code, and no AmiBroker needed.
Every block is checked before a run. A strategy that can never trade is stopped with the reason, instead of returning an empty report.
No code, ever
Drag blocks onto a canvas and wire them: price, indicators, conditions, entries and exits. If you can draw a flowchart, you can build a strategy.
Blocks that remember
Count bars since a setup, hold the highest high since a signal, latch a value, or arm on one condition and fire on another. In many tools this takes custom code.
16 timeframes, mixed freely
From 1 minute to monthly, chosen block by block. A daily trend filter with a 15-minute entry is two blocks, not a script.
Indian charges built in
STT, exchange fees, SEBI fee, stamp duty and GST at each segment’s own rates, plus your broker’s brokerage and optional slippage.
No lookahead
Signals read only finished bars, and trades fill at the next bar’s open. Enforced by the engine, not a setting you can forget.
A real portfolio
Slots, a rule for which signal wins when slots are full, five sizing methods and T+1 settlement. Change them and the report re-prices instantly.
174 blocks in 14 families.
Everything a strategy needs, from the price itself to the order that acts on it.
See all the indicators
EMA, SMA, RMA, WMA, DEMA, TEMA, Hull MA, KAMA, ALMA, ZLEMA, VWMA, T3, VIDYA, McGinley, TRIMA, RSI, Stoch RSI, Connors RSI, MACD, PPO, TRIX, TSI, Stochastic, Williams %R, CCI, MFI, ROC, Momentum, CMO, RMI, Awesome Osc, Ultimate Osc, SMI, KST, Coppock, STC, PMO, RVI, QQE, Wave Trend, Fisher Transform, ATR, ATR %, ADX, Aroon, Vortex, Choppiness, VHF, RWI, Historical volatility, Ulcer index, Mass index, Chaikin volatility, StdDev, Bollinger Bands, BB %B, BB Width, Keltner, Donchian, STARC, Envelope, TTM Squeeze, Supertrend, Parabolic SAR, Chandelier Exit, Ichimoku, Alligator, Heikin Ashi, VWAP, Anchored VWAP, OBV, A/D line, CMF, Chaikin Osc, Klinger, Force Index, Ease of Movement, PVT, NVI, PVI, Volume Osc, Volume ROC, TVI, Relative volume, Elder Ray, BOP, QStick, Linear regression, LinReg slope, R-squared, TSF, DPO, Median, Highest N, Lowest N, Bars Since, Gap, Pivot points, Woodie pivots, Fibonacci pivots, Camarilla, CPR, Pivot highs/lows, Fibonacci retracement, Previous H/L/C, Opening range, Initial balance.
See all 23 candle patterns
Doji, Dragonfly Doji, Gravestone Doji, Spinning Top, Bullish and Bearish Marubozu, Bullish and Bearish Engulfing, Bullish and Bearish Harami, Hammer, Shooting Star, Piercing Line, Dark Cloud Cover, Tweezer Bottom, Tweezer Top, Morning Star, Evening Star, Three White Soldiers, Three Black Crows, Inside Bar, Outside Bar, NR Bar.
Stateful blocks: the part other tools make you code.
Most backtesters compare values on the current bar. These blocks carry memory from bar to bar, so ideas like “within five bars of a setup” take one block.
Bars Since
How many bars since a condition last fired: 0 on the bar it fires. Ideal for “enter within N bars of the setup” and re-entry cooldowns.
Accumulator
A running value since a reset: max, min, sum, count, mean, product, largest move, first value or last value. The highest high since entry is one block.
State
Remembers what you wrote on the previous bar, with a starting value and a reset. Build arm-then-fire logic and simple state machines.
Nth Bar
True on the Nth bar of the day, week or month. Trade the first 15-minute bar, or the first session of the month.
Anchored VWAP
VWAP that restarts whenever its anchor condition fires: from a breakout, a gap or the start of a swing.
Previous (n)
Any value n bars ago, always read from a finished bar. Compare today with yesterday without ever peeking ahead.
Example: buy when the close breaks above the 20-bar high, but only within 5 bars of RSI first crossing 50. That is Bars Since (RSI crosses 50) ≤ 5 AND Close crosses above Highest 20. Two blocks, no code.
Timeframes
Mix timeframes, block by block.
Every block has its own timeframe. A daily trend filter, an hourly momentum check and a 5-minute entry can sit in the same strategy. Higher-timeframe values line up with your trading bars automatically, and a daily block mid-session only sees the day so far.
Entries and exits
Long, short, stops and square-off.
- Buy and sell entries and exits: long, short or both, with reversal on the same bar
- Optional limit entry: fill only when price comes back to your level
- Stop loss and target as a percentage or a computed price, such as 2 × ATR
- Trailing stop with a trigger and an offset
- Time exit after a set number of bars or sessions
- Intraday square-off at 15:15 by default, or your own time
- MIS, CNC or Auto: square off daily, hold overnight, or decide by timeframe
No lookahead, by design.
Lookahead is the most common way a backtest lies: the strategy quietly uses a price it could not have known. The AmiFeedX engine rules it out.
Decide on the close, fill on the next open
A signal is decided when a bar closes and the trade fills at the next bar’s open. If there is no next bar before square-off, the entry is skipped rather than filled at the signal close.
Daily, weekly and monthly decide on finished bars
A daily strategy decides on the finished day and fills at the next session’s first open. Weekly and monthly strategies decide once per finished period.
Pivots appear when they are confirmed
Pivot highs and lows and Fibonacci retracements switch on at the bar that confirms them, not the bar they are drawn on.
Tested against chance
The engine’s test suite feeds strategies that should have no edge and checks that their win rate stays close to a coin flip.
Portfolio
Test it the way you would trade it.
A strategy runs across your whole watchlist with limited capital, just like real trading. These settings live on the report and re-price it instantly, without running the test again.
- Slots: 1 to 50 positions open at once
- When slots are full: alphabetical, price low to high, price high to low, lowest risk first, or random with re-roll
- Sizing: equal per slot, fixed quantity, fixed amount, % of equity, or % risk per trade from the stop distance
- Settlement: T+1, so sale money is available the next day, or same-day
- Bench: rest a symbol after N losses in a row and bring it back after M wins, and see the P&L it saved or cost
- No entry after: drop late-day intraday entries
- Slippage: on entries, exits or both, fixed or varying, with a separate setting for stop exits
- Compare slots: one click runs 1, 3, 5, 10, 15, 20 and 30 slots side by side
Indian charges, at each segment’s rates.
Each trade is charged by its own segment: a same-day round trip as intraday, otherwise delivery, and futures, options, currency and commodity at their own rates.
| Segment | STT / CTT | Stamp duty (buy) | Exchange (NSE) |
|---|---|---|---|
| Equity delivery | 0.1% on both sides | 0.015% | 0.00307% |
| Equity intraday | 0.025% on the sell side | 0.003% | 0.00307% |
| Futures | 0.05% on the sell side | 0.002% | 0.00183% |
| Options | 0.15% of premium, sell side | 0.003% | 0.03553% |
Your brokerage, your way: flat per order, a percentage, or the lower of the two. Presets for Zerodha, Upstox, Angel One and Dhan, or set your own.
A report that shows everything.
The headline
Net P&L, CAGR after costs, maximum drawdown, Calmar, trades with win rate and skipped trades, total costs and final capital.
The details
Gross and net returns, each charge itemised, slippage, profit factor, expectancy, Sharpe, Sortino, recovery factor, streaks, holding times, and target and stop hits.
Versus buy and hold
How the strategy did against simply buying and holding the same stocks over the same dates, before and after costs.
Every symbol
Each stock tested on its own with the whole capital: net P&L, win rate, trades, drawdown, profit factor and Sharpe.
Every trade
Entry and exit, quantity, charges, the move it reached and how much it gave back, with a candle chart of each trade.
Yours to keep
Equity curve before and after costs, live results while a run is in progress, and every trade exported to CSV.
Runs on your machine, with your broker’s data.
Your desktop app
The AmiFeedX Windows app runs your backtests and fetches history from your broker. Results appear in the web app.
Or a Linux agent
Install the agent on an Ubuntu VPS with one command and it keeps testing while your PC is off. It works with Zerodha, Upstox, Angel One and AliceBlue, and updates itself.
Cached and quick
Finished date ranges are cached, so re-running a test does not fetch them again. Today’s data is always fresh.
Start faster: clone a ready-made template, group your strategies, and let auto-save keep your work as you build.
Honest about the limits, too.
A backtest you can trust says what it does not model. These are the ones that matter.
Drawdown on closed trades
Maximum drawdown is measured on booked profit and loss. An open position that dipped and recovered before closing does not show that dip.
Today’s index lists
A watchlist of today’s NIFTY 50 tested over many years leaves out companies that dropped out. That flatters long tests.
Stops fill at their level
Stops and targets fill at the price you set, even if the market gapped past it, and a target is checked before a stop on the same bar. Use stop slippage to be conservative.
One position per symbol
No pyramiding into the same stock, and results are unleveraged. MIS and F&O margin are not modelled.
Buy and hold has no costs
The buy-and-hold comparison does not deduct its own charges, so it looks slightly better than it would be.
No automatic optimiser yet
There is no parameter sweep, walk-forward or Monte Carlo test today. Save variants and compare them, or let your AI assistant do it.
A backtest is evidence, not a promise. Past results do not predict future returns. See the risk disclaimer.
Backtest questions
Do I need AmiBroker or AFL to backtest?
No. The backtester is AmiFeedX’s own engine. You build strategies from blocks in your browser; nothing is written in AFL and AmiBroker is not involved.
Where does the price data come from?
From your own broker’s historical data, fetched by your AmiFeedX desktop app or by a Linux agent you run on a VPS. Closed date ranges are cached, so a re-run does not fetch them again.
When does a trade fill?
A signal is decided on a bar’s close and the trade fills at the next bar’s open. Stops and targets fill at their level. This cannot be switched off, so no result depends on prices you could not have traded.
Can I test intraday strategies?
Yes, on timeframes from 1 minute, with a square-off time (15:15 by default) and an optional “no entry after” time. Intraday backtests are part of the paid plans.
Can it go short?
Yes. A strategy is long, short or both depending on which entry and exit blocks it uses, and it can reverse on the same bar.
Can I optimise parameters automatically?
Not yet. You can save variants and compare them, and your AI assistant can run and compare several for you, but there is no automatic parameter sweep or walk-forward test today.
Test your idea first.
9 in 10 F&O traders lost money in SEBI’s study. Free for 7 days.