- Hi MarkI am a complete novice at writing code and using Quant Editor, but I’ve today worked through QE article ‘Add new statistical value‘ and have the following comments:1. Strictly following Section 3 results in a compilation error. Suggested VRatio() code is cause of error:setName(L.t(“VRatio”));setTooltip(L.t(“VRatio”));Whereas using default code of:setName(“VRatio”);setTooltip(“VRatio”);results in successful compilation. Is this change in code correct?2. Strictly following Section 3 results in a compilation error. Suggested getValue() code of ‘getCorrectPlType(plType)’ is cause of error. Looking at other files, they all appear to use ‘getGlobalPlType(plType)’ instead. This allows for successful compilation. Is this change in code correct?3. Where can I obtain full listing of ‘StatsConst’ values that can be defined, so that I can attempt to define my own ratios?Otherwise using QE worked well for me.ThanksAC1962
Further to my post above: Item 3. I have subsequently found the listing of available ‘class constants’ on web page: https://strategyquant.com/doc/article/statsvalues-constants.html
One of the listed class constants I wish to use is: DEGREES_OF_FREEDOM. However, this class constant currently returns ‘0’ value for all my strategies loaded into QA, although within SQ a non-zero value for statistic ‘Degrees Of Freedom’ is given for each strategy. Please can you investigate and confirm what has gone wrong and why QA is currently returning ‘0’ value for DEGREES_OF_FREEDOM?
there were some minor updates in the program, so it might be that my older examples have to be tweaked to make them compile.
As for DEGREES_OF_FREEDOM – this is a measure computed from strategy complexity, not from its history results, so it is zero in QA. It is because QA doesn’t have access to the strategy properties, it loads only trading history.
Degrees of freedom basically tells you how complicated the strategy is and how many parameters it uses, smaller number means the strategy uses less parameters which is usually better.
Thanks. So am I correct is assuming that the DEGREES_OF_FREEDOM constant will be accessible as a calculated non-zero value for use within an SQ4 snippet, but not in QA?
If so, this is fine as I eventually wish to access the DEGREES_OF_FREEDOM constant in SQ4 to create a user defined ratio to filter on.
You must be logged in to reply to this topic.