- ago
Looking to Preload bars for optimizer in blocks (and backtests but not as important). Presently appears to start bars at time periods in setting and starts indicators once enough bars are present.

Would be good to optimize for specific periods at times, last month, last quarter, last n year. But if there are larger time periods for optimizer the results are not neccessarly an equizalent time period when viewing in Tabular.

Another option which may be good for other areas as well would be added Metrics, Last Month, Last Quarter, Last Year, Last 5 Years, or Last N Periods.

I did not see any way to do and did not see in any discussions. If possible point me in the direction or advise.

Thank you, Jon
0
524
10 Replies

Reply

Bookmark

Sort
Cone8
 ( 7.89% )
- ago
#1
What do you mean by Preload, exactly?

QUOTE:
Would be good to optimize for specific periods at times, last month, last quarter, last n year.
This isn't clear to me either. Do you mean like a WFO (Walk-Forward Optimization)?
1
Glitch8
 ( 11.29% )
- ago
#2
I’m unclear as well. Let’s remove the tag pending clarification. It sounds like Jon is requesting a blanket rewrite of the optimization system 🤷🏼‍♂️
0
- ago
#3
@mrjonj - would a specific example, perhaps, be this?

You want to optimize or back test a strategy for say a period of 6 months on the daily scale. But, because your strategy is using various indicators that require a "warm-up" period, then you'd like something like a separate setting that allows a preload of data that is just prior to the 6 months utilized for your optimization or back test. The preloaded data does not have any trades placed within its timeframe, but the preloaded data is utilized to make sure indicator values are valid for the entire 6 month test.
0
- ago
#4
Paul would be correct, thank you. "like a separate setting that allows a preload of data that is just prior to the 6 months utilized for your optimization or back test. The preloaded data does not have any trades placed within its timeframe, but the preloaded data is utilized to make sure indicator values are valid for the entire 6 month test"

Sorry I used pre load as opposed to warm up.

Also as in og post. A few extra metrics options of last month apr, last quarter apr, last year apr, etc, could serve the same purpose. This also allows to see trends changing of an existing backtest by running updated optimizations.
0
Glitch8
 ( 11.29% )
- ago
#5
We actually already have a mechanism in place for this, via the StartIndex property. It's set automatically for Building Block strategies, based on the longest indicator period specified. For C# Coded strategies you need to assign it an appropriate value.

All data prior to "StartIndex" is considered pre-loaded, and does not count for the equity curve and backtest period for the strategy and they benchmark analysis.
0
- ago
#6
No, this is not the case and not what i'm experiencing. It is only populating indicators, trades, and optimizating, only after warm up well after the start date in settings





3 months/60 days in settings, 40 days warm up, only 20 days showing indicator and trades.


All the 0.00 in optimizers are populated after I add preceding days to settings, and there are trades for period but is not warmed up apparently.
0
- ago
#7
0
Cone8
 ( 7.89% )
- ago
#8
The issue it seems is that the StartIndex initializes the optimization with the parameter(s) default value(s).

So that the optimization starts at the same point for all runs, the StartIndex needs to be set automatically at the longest period for all indicators. The trade off is the ability to compare runs with access to the same data vs missing trades at the beginning of runs that could have been valid with a smaller index.

For now, you can do this manually by adjusting the parameter value of the indicator with the longest period it's highest value and save it as the default before running an optimization.
0
Glitch8
 ( 11.29% )
- ago
#9
Cone, what about people like me who prefer the “as designed” behavior over your proposed change?
0
- ago
#10
Here is an idea of how such bar "prefetch" functionality could operate.

First, the current functionality as related to StartIndex, must be preserved so that the outcome of existing strategies is not impacted. This implies the addition of a binary option, probably on the strategy settings tab, that allows the user to utilize the existing StartIndex protocol (as the default), or the new "prefetch" functionality. A check box is implied.

As for the new "prefetch" functionality, here is and example of how it would work, with a strategy that uses a 200 SMA, and that is the longest period of any of the strategy's indicators:

The user checks the "Prefetch" box (or whatever you'd call it) on the Strategy Settings tab.
The user wants to run the strategy with a daily scale and has data range from 5/1/2021 to 5/1/2022 (MM/DD/YYYY)
200 bars prior to 5/1/2021 are loaded along with all bars from 5/1/2021 to 5/1/2022.
The system sets the StartIndex to 200. The StartIndex points to 5/1/2021 which is what the user entered as the start of the data range.

The above differs from the current functionality, given the example, in that current functionality would have bar 200, the StartIndex, align with 2/15/2022, presuming symbol MSFT in the U.S. market for the example.

Of course, if "All Data" is selected, then the new "Prefetch" functionality would not differ from the current functionality. And, when optimizing, the StartIndex can fluctuate because periods, of course, can be optimized. In turn, that impacts comparisons of optimization results. But, I believe you have this with existing functionality, because the data range window is too shifting with the optimization parameter values impacting StartIndex.

Granted this new functionality would increase product complexity, potentially user confusion, and have an impact on user support.
0

Reply

Bookmark

Sort