Backtesting
When you submit the Python code and general settings, we execute the backtest as follows:
-
Start at the start date
-
Execute user code
-
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)
-
Repeat until we have reached the end date
Here is an illustration:
Important Concepts
-
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
-
We skip non-trading days. In the backtest image above, we skip January 1st, 2020 because it is not a trading day.
-
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:
- We follow the times of the NYSE.
Last updated on