Strategy Lab / Backtest exercise 01
When can a close-based signal fill?
Two backtests see the same signal. One fills at the close that triggered it. The other waits for the next open. Give both records to the AI you already use and see if it can explain the difference.
Audit the two records
Paste the complete prompt into your AI, or work it out from the six price rows. Compare the answer with the key when you’re ready.
Audit these two candidate backtest records. Use only the information below. Synthetic prices, February 3–10, 2025. Both records model 10 basis points of price cost on one buy. The exercise stops at the first fill and omits separate commissions, taxes and additional market impact. Start in cash. After each session's final close is published, compare it with the mean of the last three completed closes, including that session. Issue the first buy signal when the final close is above the average. This exercise supplies only daily open and final close prices. There is no pre-close estimate or order staged in advance. date,open,close 2025-02-03,100,101 2025-02-04,101,99 2025-02-05,99,97 2025-02-06,97,96 2025-02-07,96,100 2025-02-10,103,106 Record A Signal: 2025-02-07 after final close Fill: 2025-02-07 at final close Reference price: 100.00 Modeled price per share: 100.100 Record B Signal: 2025-02-07 after final close Fill: 2025-02-10 at next supplied open Reference price: 103.00 Modeled price per share: 103.103 Calculate the three-close mean at the signal. For each record, say which inputs were available when the order could have been placed. Identify the timing error, if any, and explain whether the other record is consistent with the stated simulation assumptions. Recompute its price with the modeled cost. State what daily data can establish about execution. Report any missing evidence and distinguish calculation from a code run.
Use the check on your own strategy
Give your AI one dated signal, its source data, and the order and fill assumptions. Ask it to reconstruct what was available at each step.
Copy the general look-ahead audit prompt · Run the full synthetic example