Direct answer
A responsible backtest for RSI and MACD focuses on reproducibility and uncertainty. You define the indicator settings and any decision rules explicitly, apply them to historical price series using a consistent “known in advance” data policy, model costs and execution assumptions, and validate results with out-of-sample testing (plus bias checks). The goal is not prediction; it is to verify whether your specific definitions behave as expected under clearly stated assumptions.
Mechanism and definitions
RSI (Relative Strength Index) and MACD (Moving Average Convergence Divergence) are indicators derived from price series. RSI typically converts recent price movement into a bounded oscillator, while MACD compares moving averages and uses their difference (often with an additional signal line).
To backtest responsibly, start by separating stable mechanics from variable conditions:
- Stable mechanics (your code and definitions): the RSI period, MACD fast/slow settings, any signal/ histogram calculations, and the sampling frequency.
- Variable conditions (what changes by market and implementation): volatility regime, spread/fee structure, slippage, bar timing (when a bar closes), and how orders are filled.
Make every calculation assumption explicit. For example, state whether indicator values are computed using the bar close, whether you act on the next bar open, and how you handle missing data or corporate actions (less common for forex, but still relevant for data continuity). If your backtest uses bar data, you should also specify the exact rule for aligning indicator timestamps with the execution timestamp.
If you combine RSI and MACD, define the combination as a deterministic function (for instance, “condition A from RSI and condition B from MACD must both be true”). Avoid describing it as a vague “signal”; write the rule in plain logic so another person can verify it.
Evidence, example workflow, and bias controls
A practical responsible workflow looks like this:
-
Freeze settings before testing. Decide RSI and MACD parameters, entry/exit logic, and risk or position sizing rules once. Do not change them after inspecting performance.
-
Model costs and execution assumptions. Even if you do not know exact trading conditions, you must state what you assume: fixed per-trade costs versus variable costs, and whether fills occur at the next bar open, at bid/ask, or with a slippage term. Without cost modeling, backtests often overstate results.
-
Use out-of-sample validation. Split data into at least two segments: one for developing/validating rules and another held out for testing. Prefer walk-forward testing (rolling windows) so you evaluate across time rather than a single static split.
-
Control overfitting and multiple-testing bias. Try to avoid repeated parameter tuning based on the same evaluation window. If you test many variations, define selection rules in advance, or treat the final performance as exploratory rather than confirmed.
-
Measure performance in a way that matches the question. Instead of focusing only on total return, track distributional and consistency measures that reflect uncertainty (for example, the stability of returns across periods, maximum drawdown behavior, and how results change when costs are increased).
Material limitation and failure mode
A common failure mode is data leakage and timing errors: computing indicator values using information from a bar that would not have been available at execution time. Another is regime dependence: indicator relationships can hold in one market environment and fail in another. A responsible backtest should reveal these weaknesses by testing across multiple periods and by including a cost-and-execution sensitivity view.
Verification and next questions
To independently verify your RSI+MACD backtest, someone should be able to reproduce it from your written specification alone:
- the price data source and timeframe,
- RSI and MACD parameter values,
- exact indicator computation and timestamp alignment,
- the deterministic combination rule,
- the execution timing rule,
- and the cost/slippage assumptions.
If any of these details are missing, the “results” are not verifiable and may reflect implementation quirks rather than the indicators’ behavior. As a next question, verify whether your conclusions remain similar when you slightly change bar alignment, increase assumed costs, or test other time windows; if conclusions collapse under minor changes, treat them as weak evidence.
Conclusion
Responsible RSI and MACD backtesting is less about finding attractive historical numbers and more about enforcing clear definitions, realistic assumptions, bias controls, and out-of-sample validation.