Market Timing Backtesting Tool (SMA Crossover)
Instructions:
- Enter a name for the asset you are testing (e.g., S&P 500).
- Paste historical price data as comma-separated values (e.g.,
100.50,101.20,100.80,...
). These should be sequential (e.g., daily or monthly closing prices). - Specify the number of data periods that constitute one year (e.g., 252 for daily trading data, 12 for monthly). This is used for applying the annual risk-free rate.
- Enter the short-term and long-term moving average periods. The long-term MA period must be greater than the short-term MA period, and you need at least as many data points as the long-term MA period.
- Optionally, enter an annual risk-free rate for periods when the strategy is out of the market (in "cash").
Data Input
Strategy Parameters (SMA Crossover)
Backtest Results for
Note: This tool backtests a Simple Moving Average (SMA) crossover strategy against a Buy & Hold approach using the historical price data you provided.
- The SMA Strategy enters the market (buys the asset) when the short-term SMA crosses above the long-term SMA, and exits (moves to cash) when it crosses below. Cash earns the specified risk-free rate (if any) when the strategy is out of the market.
- The Buy & Hold Strategy purchases the asset at the beginning of the test period and holds it until the end.