If I back test across say 1 year of M30 data but only allow my strategies to trade let’s say 6 hours of the day by using the trading session settings and close at end of session.
Would you calculate only the amount of bars over the whole year the strategy can trade during its session or the total number of bars in the year?
Here is my limited understanding and so I may misunderstand your question....
1. Degrees of freedom in terms of data = how much % of the remaining data are left for the strategy to be tested.
In another word, how many market cycles are there in given historical data. Ideally the more the merrier.
For example if an EA has a market cycle of 30 days out of a test window of 100 days, it has 70 days left out of the 100 days = 70% degrees of freedom.
So essentially it means, with a given Historical data (for backtesting, eg 5 yrs) how many trade/market cycle (if your EA is a 30 days trade cycle, eg MA 30 days) are available for testing with the given set of historical data.
2. Which would I use to calculate? The total number of bars over the whole year or number of bars that can be traded (due to the restricted time session). I think it would be the total number of bars that can be traded, to be used as your test window period, Original Degrees of Freedom component because it represent the available test window in which your strategy are allowed to trade in, the other "excess" data can't be used and hence, can't be calculated into your degrees of freedom.
3. Bottom line, a short term strategy would have more degrees of freedom compared to a longer term strategy with the same given set of historical data. To put it simply, we always try to have "more and sufficient" historical data for our strategy to go through vigorous testing (market cycles).
Example: A 3yrs historical data may be sufficient for a 1min strategy but insufficient for a D1 strategy.
So the usefulness of knowing the Degrees of Freedom (in terms of data) is basically to understand whether our historical data (use for backtesting) is sufficient for us to obtain a good representation/predictability of how well the EA has performed in the past. Is there any other benefits of using degrees of freedom?
In terms of optimization, an over curve fitted strategy offers lesser degrees of freedom. But does that mean a higher degree of freedom strategy is better? A "strict" strategy though may have lesser trading opportunities but it also eliminated a lot of "unwanted" trading possibilities that may ended up as false signals. Hence, in such cases, wouldn't lesser degrees of freedom also mean less mistakes being made by false signals?
I think one must not just look at statistical numbers and over look the importance of understanding how a strategy are being built, i.e. understanding trading rules are important too and how trading rules affects statistical results.
I like strict rules strategies and even if they offer lesser degrees of freedom, I much rather have lesser trading opportunities (by not entering wrongly due to false signals = higher PF value) than to have a strategy that trades much often but lower PF value. However, it is important to strike a balance and choose the optimal trading frequency because I also don't want to have such low trading frequency strategy that missed out too many good trading opportunities (that are not false signals).