- ago
I'm developing a 1 symbol strategy on 1 min bars. The backtest takes quite awhile which I'm okay with because I realized it is a lot of data. The thing that confuses me is that I then ran an optimization on one parameter with 50 iterations, and the optimization runs much faster than the backtest, which doesn't seem right to me...shouldn't the optimization take longer than the backtest?
0
818
Solved
16 Replies

Reply

Bookmark

Sort
- ago
#1
There is not enough evidence to make conclusions, let alone tag with #BugReport. It could be that the initial data download completed in a long time during the backtest phase.
0
- ago
#2
Sorry, I didn't mean to offend with the bug report. I'm just trying to understand what's going on. I don't think its the data download because I've run the optimization without running the backtest first and I've run the backtest several times.
0
- ago
#3
No offense but there really isn't enough details to understand what's going on. Could you for example record a screen capture to demonstrate?
0
- ago
#4
There isn't really anything to capture because its a moving process:

Symbol is TQQQ running one minute bars from 1/1/2018 to 9/28/2023

Backtest= taking a long time, 30min or more to process

Optimization on same strategy = Just took about a minute with 30 permutations.

It seems like the program freezes while running the backtest. I guess at this point it doesn't really matter b/c the results seem to be coming out fine. I just wasn't sure why it was happening.
0
Cone8
 ( 25.44% )
- ago
#5
5 years of 1-minute data for one symbol is about a half million bars. It takes time to read these large files (even longer if the data has to be converted from ASCII files). The computer hardware can make a big difference with that. It can take "quite a while" - whatever that time is.

Once the file is read after running the strategy, it's not required to reload it again for the Optimizer (unless you changed the data range). If the strategy runs quickly, then there's your explanation.

0
Glitch8
 ( 11.81% )
- ago
#6
After you run the backtest, does it take equally long to run the next time you click Run Backtest in the same window?
0
- ago
#7
Yes the backtest takes just as long no matter what I do.

I'm not concerned with the length of the backtest, but more curious why the optimization would be quicker than the backtest.

It seems like maybe one of the reports generated from the backtest is bogging it down?
1
Cone8
 ( 25.44% )
- ago
#8
Definitely.
You can try removing some/all Visualizers and add them back until you find the culprit.
0
- ago
#9


does this help at all. It looks like the elements scorecard is taking a long time.
0
Best Answer
Glitch8
 ( 11.81% )
- ago
#10
Also does your strategy create lots of plotted objects like lines etc? These are optimized out of optimizations and maybe that’s the bottleneck.

Oh just saw your post above. Yep looks like you nailed it. You could try removing that extension?
1
- ago
#11
These delays are caused by the Compare Tool. It is a great tool if you need it, but consumes too much time if you don't.

Go to Preferences->Backtest.
In the "Performance Visualizers" section deactivate "Compare"

Background
Compare Tool lets you save all metrics of a backtest. This makes it possible to compare various backtest runs and their respective metrics even if the metrics was not selected during the backtest.
And it calculates all metrics, which takes some time...

Unfortunately the current version of Compare Tool (part of finantic.ScoreCards) always calculates all available metrics. I will make this more controllable in a future version.
1
- ago
#12
@Eugene: The title is misleading. It should read:
Optimization faster than Backtest [resolved: Caused by Compare Tool]
0
Glitch8
 ( 11.81% )
- ago
#13
684894ms for the Element Scorecard to calculate. That’s 11 minutes to calculate the ScoreCard. So it’s not the Compare tool it’s the Element ScoreCard.
0
- ago
#14
QUOTE:
it’s the Element ScoreCard.

Yes. And this calculation is started/triggered by Compare Tool that wants to store all available metrics.

Without Compare Tool only requested metrics are calculated.
This will not slow down the backtest
(as long as you don't select Element ScoreCard in Metrics Report)
1
- ago
#15
I do not think DrKoch's solution worked.
0
- ago
#16
I deleted the Elements extension and the backtest only took a few seconds so that was the fix. It has never caused an issue for me before, but this is the first intra-day strategy I have worked on.
0

Reply

Bookmark

Sort