# Backtester > Backtester tests trading rules on real past daily prices. It shows every trade, why it happened, and the result next to buying and holding SPY. It is a historical test only. It does not place trades or give investment advice. People can describe a rule in plain words in the chat on the home page. AI agents can call the same engine through an MCP server. ## Use it from an AI agent - MCP server (streamable HTTP): https://backtester.daenadigital.com/mcp - Tools: list_data, get_prices, build_series, build_signal, simulate, report, list_strategies, save_strategy. - Call list_data first. It states the data and its limits before a run. ## How every test runs 1. Get data: Daily prices for each ticker, each with the date it became known. A test only sees prices known on that day. 2. Build series: New lines from old prices, using basic steps: average, high, low, change, lag, ratio. RSI and MACD are just these steps combined. 3. Build signals: Yes or no tests over time, like "price is above its average" or "one line crosses another". 4. Simulate fills: Trades in time order, with the fees and slippage the run sets. A stop on a day runs before a new buy on that day. 5. Count the money: Cash, holdings, return, and drawdown on each day, next to buying and holding SPY. ## Data limits - Prices are raw provider prices scaled at each stock split, so a split does not change the price level. Prices and share counts are in share units at the first session of the run. The report lists each split. Cash dividends are not included. Numbers you supply, such as price levels, dollar distances, option strikes and premiums, and per-share observations, are not scaled. Set them in run-start share units. - Intraday runs use the daily feed as the exchange calendar. Intraday bars on a day with no daily bar, such as a market holiday, are left out and listed by ticker in excludedSessions. - Equity is checked at each close. If it is zero or less, every holding in that book is closed at that close with reason liquidation, and the book makes no new trades. - Runs need prices for each ticker on the same session dates. - Options use an explicit premium and modeled expiry payoff. There is no live option chain. - Fundamental, earnings, and calendar event values can be supplied as observations with their release times. The price feeds do not provide these values. ## Questions - What is a backtest? A backtest runs a trading rule on old prices to see what would have happened. It shows each trade, why it happened, and the result next to SPY. It does not place trades. - Is this investment advice? No. A backtest is a test on old prices only. Past results do not predict future returns. - Can a test use future prices by mistake? No. Every value carries the date it became known, and a rule only sees values known on or before its decision date. Adding new prices never changes earlier signals or trades. - Where do the prices come from? Daily prices come from a market data provider. They are adjusted for stock splits. Cash dividends are not included, so results for both the rule and SPY leave them out. - Why is every result shown against SPY? SPY is a fund that tracks 500 large US stocks. Buying and holding it is the simplest choice an investor has, so each rule is shown next to it over the same dates. - Which rules can it test? Any rule made from the basic steps: averages, highs and lows, changes, ranks, ratios, crosses, calendar dates, stops, and targets. That covers trend, mean reversion, breakouts, rotation, pairs, and calendar rules. If a rule needs data that does not exist, it says so. - Do fees count? Each run sets its own fees and slippage, and every fill pays what the run sets, except when a modeled option expires. Slippage means each fill is at a slightly worse price than the market price that day. Each strategy page shows the fees its run used. Some saved examples use zero. The chat is told to pick 5 basis points of each unless you ask for something else. A basis point is one hundredth of one percent. - Can I use it from my own AI agent? Yes. The same tools the chat uses are open to any AI agent that supports MCP, such as Claude or ChatGPT. Add the server address shown above. ## Saved strategy backtests - [ADX trend-strength filter](https://backtester.daenadigital.com/strategies/adx-trend-strength-filter/): SPY 50 day uptrend, only while ADX(14) > 25. ADX built from basic steps. - [ATR breakout / ATR stop](https://backtester.daenadigital.com/strategies/atr-breakout-atr-stop/): QQQ one-day gain larger than ATR(14); 2 ATR stop and 3 ATR target from entry. - [60/40 balanced portfolio](https://backtester.daenadigital.com/strategies/balanced-60-40-portfolio/): SPY 60% / TLT 40%, rebalanced on the first session of each month. - [Bollinger %B mean reversion](https://backtester.daenadigital.com/strategies/bollinger-b-mean-reversion/): SPY %B below 0.05, exit above 0.8. - [Bollinger band walk (trend)](https://backtester.daenadigital.com/strategies/bollinger-band-walk/): QQQ band walk: enter on a close above the upper band, stay long until a close below the middle band. - [Bollinger lower-band bounce](https://backtester.daenadigital.com/strategies/bollinger-lower-band-bounce/): SPY close below lower Bollinger band, exit at middle band. - [Bollinger lower-band bounce (classic)](https://backtester.daenadigital.com/strategies/bollinger-lower-band-bounce-2/): QQQ buy at the lower band, sell at the upper band. - [Bollinger + RSI combination](https://backtester.daenadigital.com/strategies/bollinger-rsi-combination/): QQQ close below the lower band AND RSI(14) under 35; exit at the middle band. - [Bollinger squeeze breakout](https://backtester.daenadigital.com/strategies/bollinger-squeeze-breakout/): SPY squeeze: band width near its 6 month low in the last 5 days, then a close above the upper band. - [Bollinger upper-band breakout](https://backtester.daenadigital.com/strategies/bollinger-upper-band-breakout/): SPY close above the upper Bollinger band, exit below the middle band. - [Buy-the-dip below the 50-day MA](https://backtester.daenadigital.com/strategies/buy-the-dip-below-the-50-day-ma/): SPY buy a close below the 50 day average, exit back above. - [Chandelier ATR trailing exit](https://backtester.daenadigital.com/strategies/chandelier-atr-trailing-exit/): SPY crosses above its 200 day average; Chandelier exit 3 ATR(22) below the highest high since entry. - [Classic pairs trading (long/short)](https://backtester.daenadigital.com/strategies/classic-pairs-trading/): KO / PEP pair: two sleeves. Below -2 z: long KO, short PEP. Above +2 z: short KO, long PEP. Exit at z = 0. - [Consolidation breakout](https://backtester.daenadigital.com/strategies/consolidation-breakout/): SPY breaks above a 20 day range that was under 4% wide; exit on a 10 day low. - [Cross-sectional momentum factor, long/short](https://backtester.daenadigital.com/strategies/cross-sectional-momentum-factor-long-short/): Nine sectors: long top 2, short bottom 2 by 12 month return (two sleeves). - [Cross-sectional momentum, top decile](https://backtester.daenadigital.com/strategies/cross-sectional-momentum-top-decile/): Nine sector ETFs: each month hold the one with the best 12 month return (top decile of a small universe). - [Defensive sector rotation](https://backtester.daenadigital.com/strategies/defensive-sector-rotation/): Monthly: SPY above 200 day average holds SPY; below it, hold XLP, XLU and XLV equally. - [Donchian channel breakout (standalone)](https://backtester.daenadigital.com/strategies/donchian-channel-breakout/): SPY Donchian: close above prior 20 day high, exit below prior 10 day low. - [TSLA daily drop](https://backtester.daenadigital.com/strategies/drop/): Buy after a 5 percent daily drop. Use a close-based 2 percent target and 5 percent stop. - [Dual momentum (absolute + relative)](https://backtester.daenadigital.com/strategies/dual-momentum/): Dual momentum: SPY vs EFA by 12 month return; hold the winner only if it beats BIL, else hold BIL. - [Equal-weight permanent / all-weather-style basket (static)](https://backtester.daenadigital.com/strategies/equal-weight-permanent-all-weather-style-basket/): SPY, TLT, GLD and DBC bought once in equal weight and held. - [52-week-high momentum](https://backtester.daenadigital.com/strategies/fifty-two-week-high-momentum/): MSFT within 2% of its 52 week high; exit when 10% below it. - [Fixed-resistance breakout](https://backtester.daenadigital.com/strategies/fixed-resistance-breakout/): SPY breaks above $300 in 2019 to 2020, 8% close stop. - [Gap-and-go (intraday)](https://backtester.daenadigital.com/strategies/gap-and-go/): SPY 5 minute bars: open gaps up over 0.5% on the first bar; buy, exit near the close. - [Gap fade / gap fill](https://backtester.daenadigital.com/strategies/gap-fade-gap-fill/): SPY 5 minute bars: short an opening gap up over 0.5%, cover at the prior close or near the end of the day. - [Golden cross (50/200 MA crossover)](https://backtester.daenadigital.com/strategies/golden-cross/): SPY 50/200 day cross. - [Ichimoku Cloud trend](https://backtester.daenadigital.com/strategies/ichimoku-cloud-trend/): SPY Ichimoku: spans shifted 26 sessions; long above cloud, exit below cloud. - [January effect](https://backtester.daenadigital.com/strategies/january-effect/): IWM held through January each year. - [Keltner channel breakout](https://backtester.daenadigital.com/strategies/keltner-channel-breakout/): SPY close above Keltner upper (20 EMA + 2 ATR10), exit below the EMA. - [Long-only relative-value pair (ratio cross)](https://backtester.daenadigital.com/strategies/long-only-relative-value-pair/): Long XLK when the XLK / XLU ratio crosses above its 50 day average. - [Low-volatility factor, long/short](https://backtester.daenadigital.com/strategies/low-volatility-factor-long-short/): Nine sectors: long the 2 calmest, short the 2 most volatile by 60 day volatility. - [Low-volatility stock selection](https://backtester.daenadigital.com/strategies/low-volatility-stock-selection/): Nine sector ETFs: each month hold the 3 with the lowest 60 day volatility. - [MACD divergence](https://backtester.daenadigital.com/strategies/macd-divergence/): SPY bullish MACD divergence: a new swing low of price (5 bars each side) is lower than the one before, while MACD at that low is higher. Exit after 20% gain or 8% loss. - [MACD histogram momentum](https://backtester.daenadigital.com/strategies/macd-histogram-momentum/): SPY MACD histogram turns positive while rising; exit when it turns negative. - [MACD + RSI combination](https://backtester.daenadigital.com/strategies/macd-rsi-combination/): SPY MACD signal cross confirmed by RSI(14) above 50. - [MACD signal-line crossover](https://backtester.daenadigital.com/strategies/macd-signal-line-crossover/): SPY MACD(12,26,9) signal line cross. - [MACD zero-line crossover](https://backtester.daenadigital.com/strategies/macd-zero-line-crossover/): SPY MACD zero line cross. - [Momentum + MA filter](https://backtester.daenadigital.com/strategies/momentum-ma-filter/): SPY: 6 month return positive AND price above 200 day average. - [Momentum threshold cross](https://backtester.daenadigital.com/strategies/momentum-threshold-cross/): QQQ 20 day return crosses above +5%, exit when it crosses below 0. - [Moving-average ribbon](https://backtester.daenadigital.com/strategies/moving-average-ribbon/): SPY ribbon 10/20/30/40/50, all stacked and price above the fastest. - [Moving-average slope trend](https://backtester.daenadigital.com/strategies/moving-average-slope-trend/): SPY long while the 50 day average rises. - [Opening-range breakout](https://backtester.daenadigital.com/strategies/opening-range-breakout/): SPY 5 minute bars: buy a break above the high of the first 30 minutes; exit near the close. - [TSLA and SPY ratio](https://backtester.daenadigital.com/strategies/pairs/): Trade the Tesla to SPY ratio against its 20 day average. - [Pairs ratio mean reversion, long leg only](https://backtester.daenadigital.com/strategies/pairs-ratio-mean-reversion-long-leg-only/): KO / PEP ratio z below -2: buy KO only, exit at z = 0. - [Price above/below 200-day MA](https://backtester.daenadigital.com/strategies/price-above-below-200-day-ma/): SPY price vs 200 day average. - [Rate-of-change (ROC) momentum](https://backtester.daenadigital.com/strategies/rate-of-change-momentum/): QQQ 6 month rate of change crosses above zero. - [Relative strength vs SPY](https://backtester.daenadigital.com/strategies/relative-strength-vs-spy/): MSFT / SPY ratio above its 50 day average. - [Risk parity (inverse-volatility / equal risk contribution)](https://backtester.daenadigital.com/strategies/risk-parity/): SPY, TLT and GLD weighted each month by inverse 60 day volatility, so each holds about the same risk. No leverage. - [Monthly top two rotation](https://backtester.daenadigital.com/strategies/rotation/): Each month, hold the top two names by 20 day return. - [TSLA RSI](https://backtester.daenadigital.com/strategies/rsi/): Buy on an RSI cross below 30. Sell on a cross above 70. - [RSI 50-line trend](https://backtester.daenadigital.com/strategies/rsi-50-line-trend/): SPY RSI(14) crosses 50. - [RSI divergence](https://backtester.daenadigital.com/strategies/rsi-divergence/): SPY bullish RSI divergence: a new swing low of price (5 bars each side) is lower than the one before, while RSI at that low is higher. Exit after 20% gain or 8% loss. - [RSI + MA filter](https://backtester.daenadigital.com/strategies/rsi-ma-filter/): QQQ RSI(14) under 35 only above the 200 day average; exit RSI over 55. - [RSI overbought/oversold swing (30/70)](https://backtester.daenadigital.com/strategies/rsi-overbought-oversold-swing/): QQQ RSI(14) below 30 buy, above 70 sell. - [RSI oversold bounce (RSI < 30)](https://backtester.daenadigital.com/strategies/rsi-oversold-bounce/): SPY RSI(14) below 30, exit above 50. - [RSI range rules (bull 40–80 / bear 20–60)](https://backtester.daenadigital.com/strategies/rsi-range-rules/): SPY RSI ranges: above 200 day, buy RSI under 40 and sell over 80; below it, buy under 20 and sell over 60. - [Santa Claus rally](https://backtester.daenadigital.com/strategies/santa-claus-rally/): SPY bought from December 24, sold from January 3. - [QQQ seasonal strategy](https://backtester.daenadigital.com/strategies/seasonal/): Hold QQQ from November to May, then stay in cash. Replay its historical signals and fills. - [Sector momentum rotation](https://backtester.daenadigital.com/strategies/sector-momentum-rotation/): Nine sectors: each month hold the top 3 by 6 month return. - [Sector relative-strength rotation](https://backtester.daenadigital.com/strategies/sector-relative-strength-rotation/): Nine sectors: each month hold the 3 whose ratio to SPY rose most over 3 months. - [Sell in May / Halloween effect](https://backtester.daenadigital.com/strategies/sell-in-may-halloween-effect/): SPY held November to April. - [Short-term oversold bounce](https://backtester.daenadigital.com/strategies/short-term-oversold-bounce/): QQQ 5 day fall below -10%, 5% target, 5% stop on closes. - [Size factor (SMB), long/short](https://backtester.daenadigital.com/strategies/size-factor-long-short/): ETF proxy: long IWM (small caps), short SPY (large caps), held. Not a ranked market-cap universe. - [Static equal-weight sector basket](https://backtester.daenadigital.com/strategies/static-equal-weight-sector-basket/): Nine sector ETFs bought once in equal weight and held (sleeves). - [Statistical arbitrage (multi-pair)](https://backtester.daenadigital.com/strategies/statistical-arbitrage/): Three daily pairs as long/short sleeves (20 day z-score). Real stat arb uses many pairs and intraday speed. - [Stochastic oversold bounce (%K < 20)](https://backtester.daenadigital.com/strategies/stochastic-oversold-bounce/): SPY stochastic: %K below 20 crossing above %D, exit above 80. - [Supertrend trend following](https://backtester.daenadigital.com/strategies/supertrend-trend-following/): Supertrend(10, 3): bands at mid price plus or minus 3 ATR that only move toward price until price closes through them. Long while price is above. - [Tactical trend asset allocation](https://backtester.daenadigital.com/strategies/tactical-trend-asset-allocation/): Monthly: hold SPY above its 200 day average, otherwise hold TLT. - [Trailing-stop trend following](https://backtester.daenadigital.com/strategies/trailing-stop-trend-following/): Trailing stop: exit when price falls 8% of the current close below the highest high since entry. The rule says highest close. - [Triple MA crossover (5/20/50)](https://backtester.daenadigital.com/strategies/triple-ma-crossover/): QQQ 5/20/50 stacked averages, AND signal. - [Turn-of-the-month effect](https://backtester.daenadigital.com/strategies/turn-of-the-month-effect/): SPY bought from the 26th, sold from the 4th of the next month. - [Turtle breakout](https://backtester.daenadigital.com/strategies/turtle/): Buy a 20 day high breakout. Use range-based sizing, adds, and a stop. - [Turtle trend following (System 1/2)](https://backtester.daenadigital.com/strategies/turtle-trend-following/): QQQ Turtle System 1: 20 day high entry, 10 day low exit, 2 ATR stop, ATR risk sizing, adds every 0.5 ATR up to 4 units. - [12-month momentum (absolute)](https://backtester.daenadigital.com/strategies/twelve-month-momentum/): SPY long while 12 month return is positive. - [Value factor (HML), long/short](https://backtester.daenadigital.com/strategies/value-factor-long-short/): ETF proxy: long IWD (value), short IWF (growth), held. Not a book-to-market sort. - [VIX-spike mean reversion (buy equities on fear)](https://backtester.daenadigital.com/strategies/vix-spike-mean-reversion/): Buy SPY when VIXY jumps 30% above its 20 day average; hold 10 days via a 3% target or 5% stop. - [Volatility targeting](https://backtester.daenadigital.com/strategies/volatility-targeting/): SPY sized each month to target 15% yearly volatility from 20 day volatility, at most 100%. - [Volume-confirmed breakout](https://backtester.daenadigital.com/strategies/volume-confirmed-breakout/): SPY 20 day breakout only on volume above 1.5x its 50 day average; exit on a 10 day low. - [VWAP mean reversion (intraday)](https://backtester.daenadigital.com/strategies/vwap-mean-reversion/): SPY 5 minute bars: session VWAP from session sums; buy below VWAP, sell back above it or near the close. - [Williams %R oversold bounce](https://backtester.daenadigital.com/strategies/williams-r-oversold-bounce/): SPY Williams %R(14) below -80, exit above -20. - [Z-score mean reversion](https://backtester.daenadigital.com/strategies/z-score-mean-reversion/): SPY 20 day z-score below -2, exit at 0. ## Pages - [Home and chat](https://backtester.daenadigital.com/) - [Strategy library](https://backtester.daenadigital.com/strategies/) - [About](https://backtester.daenadigital.com/info/about/) - [Terms](https://backtester.daenadigital.com/info/terms/)