Simulation
How to run a reproducible backtest
Set the signal time, execution model and validation period so someone else can reproduce the result.
Specify when the rule can see the data
For a signal evaluated at the close of an hourly candle, the closing price is available after the hour ends. Document when the backtest is allowed to execute. Using an earlier price from the same candle for the fill introduces information from the future.
Document the data source, time zone, treatment of missing data and indicator warm-up period. Decide how to handle incomplete candles before you look at performance.
Set execution order and costs
If one candle touches both the profit target and the protective exit, OHLC alone cannot establish which came first. Use smaller timeframes or define a rule for ambiguous candles before testing. Count the cases in which that rule affects the result.
Include costs and run a second scenario with less favorable fills. Report the number of trades, net outcome and maximum drawdown separately. A higher final balance can coexist with a long period of losses.
Save the validation period for the end
Choose settings on one segment of history, then test them on a later, previously unused segment. Record each version you try. Tuning repeatedly on the validation segment makes it another training period and makes performance on new data harder to assess.
Two levels inside one candle
The simulation enters at 100, the protective exit is 95 and the target is 108. The next candle has a low of 94 and a high of 109. Establish the sequence from more detailed data or apply your documented ambiguity rule. Mark the case in the report.
Try it yourself
Keep the date ranges, candle source, cost settings and execution logic. Give another person the same inputs to see whether they can reproduce the test.
Sources and documentation
Examples are for educational purposes. Trading crypto-assets involves the risk of losing funds.