Multimarket analysis in SQX

One of the most important goals in analyzing the strategies generated in StrategyQuantX is to eliminate the risk of overfitting. StrategyQuant provides a wide range of tools for filtering and analyzing strategies.

One approach to determine if a strategy is overfitting for only certain historical data is to know what works in multiple markets.

In StrategyQuant X, you can do this by setting up multiple markets in the Additional Markets section. Performance in multiple markets can then be determined by looking at the performance of the entire portfolio.  (databank values with portfolio setting). For some indicators, we get the cumulative value, for others the average value.

However, this approach has some weaknesses that we have tried to address by adding new snippets. These are the median values of selected indicators in each of the additional markets. Why did I use median values and not average values?

Below is a brief comparison of the two approaches.

Source:  https://www.diffen.com/difference/Mean_vs_Median

Let us imagine a situation where we test the strategy on 20 additional markets. We will have a situation where the strategy performs poorly in 18 markets and very well in 2 markets. The arithmetic mean will be much more optimistic than the median. The arithmetic mean is not appropriate in this case because it tends to give more positive data than reality.

A similar example of the condition i is when you have fewer relatively good results and more negative results.

How do you install these snippets: https://strategyquant.com/doc/programming-for-sq/import-export-custom-indicators-and-other-snippets/

How do you add a snippet to a databank view?

First, you create a new databank view or modify an existing one.

Then use add columns to select the AddmarkestNetProfitMedian …

Here it is important to set the portfolio computation for each snippet so that we get the correct results.

 

You can download snippets here.

 

 

clonex / Ivan Hudec

Ivan Hudec — “Clonex” on the forum

I’ve been trading for 15 years and building with StrategyQuant X since 2014. These days I do three things: I develop and battle-test automated strategies, I extend SQX itself with custom indicators, snippets, and Python tools for machine learning and quant research, and I help other traders get there faster — without the years of expensive mistakes I made along the way.
Most retail strategies look great on a backtest and fall apart live. My work is about the opposite: strategies that are honest, validated, and robust enough to trust with real money. I write about that process — the good, the ugly, and the overfitting nobody talks about — on my site, algotrading.space.
If you want to go deeper on validation, custom SQX development, or building a real edge with data and code, that’s where I share it all.  www.algotrading.space

0 Comments
Oldest
Newest Most Voted

Continue reading