Backtesting is the general method for seeing how well a strategy or model would have done ex-post. Backtesting assesses the viability of a trading strategy by discovering how it would play out using historical data. Backtesting allows a trader to ato de forex a trading strategy using historical data to generate results and analyze risk and profitability before risking any actual capital.

A well-conducted backtest that yields positive results assures traders that the strategy is fundamentally sound and is likely to yield profits when implemented in reality. A well-conducted backtest that yields suboptimal results will prompt traders to alter or reject the strategy. As long as a trading idea can be quantified, it can be backtested. Some traders and investors may seek the expertise of a qualified programmer to develop the idea into a testable form. Backtesting assesses the viability of a trading strategy or pricing model by discovering how it would play out using historical data.

If backtesting works, traders and analysts may have the confidence to employ it going forward. The ideal backtest chooses sample data from a relevant time period of a duration that reflects a variety of market conditions. In this way, one can better judge whether the results of the backtest represent a fluke or sound trading. A backtest should consider all trading costs, however insignificant, as these can add up over the course of the backtesting period and drastically affect the appearance of a strategy’s profitability. Traders should ensure that their backtesting software accounts for these costs.

Forward performance testing, also known as paper trading, provides traders with another set of out-of-sample data on which to evaluate a system. While backtesting uses actual historical data to test for fit or success, scenario analysis makes use of hypothetical data that simulates various possible outcomes. For instance, scenario analysis will simulate specific changes in the values of the portfolio’s securities or key factors take place, such as a change in the interest rate. For backtesting to provide meaningful results, traders must develop their strategies and test them in good faith, avoiding bias as much as possible. That means the strategy should be developed without relying on the data used in backtesting. Traders generally build strategies based on historical data. One way to compensate for the tendency to data dredge or cherry pick is to use a strategy that succeeds in the relevant, or in-sample, time period and backtest it with data from a different, or out-of-sample, time period.

If in-sample and out-of-sample backtests yield similar results, then they are likely generally valid. The offers that appear in this table are from partnerships from which Investopedia receives compensation. Quantitative trading consists of trading strategies which rely on mathematical computations and number crunching to identify trading opportunities. Trend analysis is a technique used in technical analysis that attempts to predict the future stock price movements based on recently observed trend data. Day traders execute short and long trades to capitalize on intraday market price action, which result from temporary supply and demand inefficiencies. Fuzzy logic is a mathematical logic that attempts to solve problems with an open, imprecise spectrum of data that makes it possible to obtain an array of accurate conclusions.