Skip to content
All library documents

Counting Unique Data Inputs in Trading-System Complexity

Article Quant Q&A · Author: MMsmithH

Summary

The document asks how to count degrees of freedom when assessing a trading system’s complexity. It presents a framework that combines the system’s rules with the market observations those rules consume, and cites examples in which two moving averages on the same closing-price series share some counted inputs, while indicators using different price fields do not. The central question is whether an SMA and an EMA using the same prices should count those observations once or separately.

No definitive rule or answer is provided. The document raises the distinction between unique raw observations and repeated use of the same observations in different calculations, but does not resolve how indicator lookback windows, overlapping samples, or derived values should be treated. It is therefore useful as a framing of a model-complexity and backtest degrees-of-freedom issue, rather than as an established counting method. The cited examples are reported secondhand and do not supply a general procedure for applying the framework.

Key ideas

  • Degrees of freedom are framed as trading rules plus the data points those rules consume.
  • The document asks whether shared price observations used by multiple indicators should be counted once.
  • It contrasts moving averages that use the same price field with indicators using different fields.
  • It poses, but does not resolve, how to count inputs shared by an SMA and an EMA.

Tags

Full text
# Quantification of Complexity in Trading Systems


# Quantification of Complexity in Trading Systems












I am trying to define and quantify the complexity of a trading system, where complexity is measured by degrees of freedom as the sum of its rules and unique data points.

where:

```
degrees of freedom = rules + data points
```

and this may be used in (see explanation by Pardo Design, Testing, and Optimization of Trading Systems, 1992)

```
Calculation of the degrees of freedom = whole data sample –
rules and conditions – data consumed by rules and conditions
```

In this context I am trying to properly quantify the cases where data points should and should not be counted twice.

I have seen the application of this rule described (see Trading Systems A New Approach to System Development and Portfolio Optimisation By Urban Jaekle, Emilio Tomasini 2nd Edition, 2019) in examples similar to `SMA(20), close` + `SMA(10), close` equals 22 degrees of freedom, because "data points used twice in calculations are only counted once." while `SMA(20), open` and `SMA(10), close` have 30 degrees of freedom.

I would like to understand the objective rule that determines when a data point is considered distinct.

Based on this rule, would `SMA(20), close` and `EMA(10), close` have 20 or 30 data points?

If I derive EMA using SMA, calculating both with the same price points (P1, P2, ..., Pn) over a period of days (n), should I only count the data points once?

```
SMA = (P1 + P2 + ... + Pn) / n
EMA = (P1 * (2 / (n + 1)) 
       + P2 * (2 / (n + 1)) * (1 - (2 / (n + 1))) 
       + P3 * (2 / (n + 1)) * (1 - (2 / (n + 1)))^2 
       + ... 
       + Pn * (1 - (2 / (n + 1)))^(P1 - n))
```

What are the objective rules that help define when a data point is unique and when should datapoints not be counted twice?

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.