Backtesting in specific periods

 
Hello everyone, good afternoon.

I'm seeking guidance on the feasibility of conducting backtesting using the Strategy Tester + Strategy Optimizer, specifically for a specific month within a defined range of years.

To be more specific, I would like to know if it's possible to select, for instance, the month of February from 2016 to 2023, and obtain results only for the chosen month. In other words, when the first day of March is reached, the backtesting would automatically skip to the next year, starting the test again in the previously selected month. This approach would save time and processing resources by exclusively testing the desired month.

Has anyone dealt with this need before or have any guidance on how to implement this functionality? I appreciate in advance for any help or insights provided.
 
You have to create a time filter in your code. Strategy tester won't do that for you.
 
Yashar Seyyedin #:
You have to create a time filter in your code. Strategy tester won't do that for you.

I know that I will have to create a filter, however, it is not very clear to me how this filter should be implemented, as the filter that I need to implement must jump to the following year at the end of the selected month. Any ideas on how I should do this implementation?

 
Jeovane Reges #:

I know that I will have to create a filter, however, it is not very clear to me how this filter should be implemented, as the filter that I need to implement must jump to the following year at the end of the selected month. Any ideas on how I should do this implementation?

Just close all trades at the end of February after that skip all the activities within time period from March to end of January. Then start again on next February.

 
Cuong Vu #:

Just close all trades at the end of February after that skip all the activities within time period from March to end of January. Then start again on next February.

In order to speed things up, I would not like to go through the other months but rather skip to the following year. However, I don't know if this type of implementation is viable. It's viable?

 
Jeovane Reges #:In order to speed things up, I would not like to go through the other months but rather skip to the following year. However, I don't know if this type of implementation is viable. It's viable?

It is not possible to skip over the date range to "speed things up".

The EA will need to simply keep ignoring the incoming OnTick events until it reaches the specified date or time to start processing and trading.

In other words, the first thing that the OnTick handler should do is check the current time, and if not within the specified period, immediately returns from the event handler.

 
Fernando Carreiro #:

It is not possible to skip over the date range to "speed things up".

The EA will need to simply keep ignoring the incoming OnTick events until it reaches the specified date or time to start processing and trading.

In other words, the first thing that the OnTick handler should do is check the current time, and if not within the specified period, immediately returns from the event handler.

Got it, thanks everyone for your contribution.

So the filter will be a simple IF checking the time and month.

Thanks again to all.

 
Jeovane Reges #:

In order to speed things up, I would not like to go through the other months but rather skip to the following year. However, I don't know if this type of implementation is viable. It's viable?

Because EAs always call OnTick() function every time there is a price change (a tick), so there is no way just "skip through" a specified date in the future. Just using a time filter then skip the function (OnTick()) is already very fast. No other way as I know of.

Reason: