Forums>StrategyQuant>General Discussion>Degrees of freedom(DOF) bigger is better?

come from description of SQX help file:

Degrees of freedom(DOF) are computed from strategy complexity and number of trades. The simpler the strategy is, the more degrees of freedom it will have. For this property, the bigger value is better.

but why the type of DOF in weighed fitness block is minimize

refer to the attached file

###### Attachments:

You must be logged in to view attached files.degrees of freedom computed from number of trades???

its absolute nonsense

i will have 2 strategies with 10 parameters, one with 500 trades, second with 1000 trades

degrees of freedom will be 490 and 990, which strategy is better? how do i compare strategies in the meaning of you words – “we want more trades and less inputs”, doesnt make any sense

degrees of freedom must be only number of variables in the strategy

You want to be a profitable algotrader? We started using StrateQuant software in early 2016. For now we have a very big knowhow for building EAs for every possible types of markets. We share this knowhow, apps, tools and also all final strategies with real traders. If you want to join us, fill in the FORM. 1500+ final SQX strategies for members running on demo accounts to verify the edge DEMO ACCS. We provide also strategies for indices - DAX, DOW JONES, NASDAQ, SP, UK, because we have realtick data from our brokers.

Realise this is a very old thread but did want to ask a question regarding this. Reading through Rob Pardo’s book he talks about the key measure being the Remaining Percentage of Degrees of Freedom. He goes on to say that this needs to be above 90% otherwise the strategy can’t be considered reliable.

His calculation for Rdf% has nothing to do with rules or trades – it has to do with total number datapoints / data points used within the strategy.

@Notch – I don’t know if you frequent these forums anymore but do you use this in your filtering process? My hunch is that by keeping sample timeframe high and detailed, conditions to a minimum and no multiple 200 MAs then I should be ok here?

@SQ – not sure if you guys want to look at this at all but I gather Pardo is a guru in this space…

Hi Notch – sorry for the late reply. Didn’t notice you’d responded.

You are of course completely correct – I wrote this when I was on page 130 and Pardo’s simple example at that point only covers number of consumed datapoints.

Anyway – think SQ picked up our conversation and amended the current calculation that was using number of trades. That was the main thing. Well that and you I being introduced :-)

Kevin Davey writes:

“Having separate calculation methods for long and short entries leads to

more degrees of freedom in the strategy.”

He also writes about looking at the ratio of number trades vs variables, so too doesFrom the documents of SQ:

“It is in fact highly recommended for your strategy to have as little configurable parameters (degrees of freedom) as possible.”From wiki:

“The number of independent ways by which a dynamic system can move, without violating any constraint imposed on it, is called number of degrees of freedom. ”Anyways, assuming everyone likes Pardo better, shouldn’t this stat be expressed in a percent then? If SQ recently changed it, then how exactly is it now calculated?

May all your fits be loose.

Thank you for clarifying. I just meant if we like “Pardo’s way” for the degrees of freedom column then it should be showing a percent and of course the higher the better for statistical significance otherwise the column should just show number configurable variables like it did before in which case the lower the better.

As it stands it seems to be neither hence my actual questions.

May all your fits be loose.

I should’ve just asked “Is this column supposed to show remaining degrees of freedom expressed as a percentage or is it supposed to show degrees of freedom in the strategy or is it supposed to show something else? If something else then what? And what is it showing now?” =)

May all your fits be loose.

@notch . just implementing https://towardsdatascience.com/algorithmic-trading-based-on-mean-variance-optimization-in-python-62bdf844ac5b for my periodically strategies rebalancing. will see if it works

@notch . just implementing https://towardsdatascience.com/algorithmic-trading-based-on-mean-variance-optimization-in-python-62bdf844ac5b for my periodically strategies rebalancing. will see if it works

Nice! I have added it to my bookmarks. it looks very interesting.

@notch – how come you’ve moved away from SQ? Were the strategies you developed not profitable in the longer term or they were but you believe you can do better?

- This reply was modified 1 year, 1 month ago by gottogethelp.

an explanation here – it is perhaps a bad name, but what we commonly refer to as Degrees of freedom – a compexity of a strategy (number of rules, conditions, parameters) is displayed as

**Complexity****column**in SQ, and the lower complexity (simpler the strategy) the better.**Degrees of freedom column**in SQ is computed as: numberOfTrades – complexityI don’t remember exactly what led me to this formula, most probably Pardo or something similar that I read:

Pardo: page 292 – measuring degrees of freedom.

“A degree of freedom then is said to be consumed or used by each trading rule and by every data point necessary to calculate indicators”.

The idea was to create a metric that has some relation between number of trades and complexity of the strategy.

We used number of trades instead of data points simply because number of bars is too big, and number of trades in backtest is a better measure of statistical significance.

So to measure “real” degrees of freedom please use Complexity column.

Mark

StrategyQuant architect

You must be logged in to reply to this topic.