Skip to Content
Backtesting

Backtesting

When you submit the Python code and general settings, we execute the backtest as follows:

  1. Start at the start date

  2. Execute user code

  3. Go to next time timespan which is of hour, day, week, month, year (if the user submits “2 day” we will jump to the next 2 days)

  4. Repeat until we have reached the end date

Here is an illustration:

backtest

Important Concepts

  1. We always execute at the start of the time timespan. Here is a list of examples:

    • Hour: We execute at the beginning of the hour, starting from 9:30 AM EST
    • Day: We execute at the beginning of the day (9:30 AM EST)
    • Week: We represent weeks as simply an timespan of five days. We start a “week” at 9:30 AM EST
    • Month: The first trading day of the month at 9:30 AM EST
    • Year: The first trading day of the year at 9:30 AM EST
  1. We skip non-trading days. In the backtest image above, we skip January 1st, 2020 because it is not a trading day.

  2. If your end date is not at the start of the time timespan, it is skipped. For example, if we have a start date of January 21, 2020 to end date of June 20, 2020, here is the list of times that we would trade for:

trading_times

  1. We follow the times of the NYSE.
Last updated on