About the usage of Total data years, Total trading years, Total data Months, Total trading Months

In the process of using SQX to develop and test strategies, I gradually understand that using  standardized indicators (mean annual indicators, monthly indicators.) as much as possible will make the work simpler and more efficient. So i usually use Avg. trades per year, Ret/DD ratio per year and so on. I know that in most cases, we test strategy and data start from on January 1 of a certain year. But in some special cases, I may import custom data(such as Non-US futures.), and the starting time of its data may be any day of the year, and I don't want to waste any data. Please see the situation shown in the attachment. Suppose I have to choose a very specific time range segment,Let me take crude oil as an example.data range is 2013/7/10-2022/10/13,That's a total of nine years, three months and three days.

1. According to code, avg. trades per year = # of trads/total data years, Is this calculation appropriate? However, Ret/dd ratio per year(custom metric)=Ret/DD ratio/total trading years.
2. What is the difference between total data and total trading? Does it mean rounding? One is small and the other is big?
3. Because there are always some test cases, the start time of the data is not necessarily January 1 at the beginning of the year, and the end time of the data is not necessarily December 31 at the end of the year. Obviously, the calculation error of monthly metric is very small. But for all standardized annualized performence metric, such as avg. trades per year, ret/dd ratio per year and so on. Considering better universality of the calculation formula.Whether it should be calculated according to the actual  days and months of sample data converted into an annual number?  In fact, I think it's accurate enough to annualize it on a monthly basis.

Attachments
total trading months.jpg
(521.26 KiB)
  • Votes +3
  • Project StrategyQuant X
  • Type Bug
  • Status Duplicate
  • Priority Normal
  • Assignee Mark Fric
  • Category Backend

History

b
#1

binhsir

25.11.2022 14:20

Task created

b
#2

binhsir

25.11.2022 14:20
Voted for this task.
E
#3

Emmanuel

25.11.2022 15:45
Voted for this task.
b
#4

binhsir

26.11.2022 01:37

Description changed:

In the process of using SQX to develop and test strategies, I gradually understand that using  standardized indicators (mean annual indicators, monthly indicators.) as much as possible will make the work simpler and more efficient. So i usually use Avg. trades per year, Ret/DD ratio per year and so on. I know that in most cases, we test strategy and data start from on January 1 of a certain year. But in some special cases, I may import custom data(such as Non-US futures.), and the starting time of its data may be any day of the year, and I don't want to waste any data. Please see the situation shown in the attachment. Suppose I have to choose a very specific time range segment,Let me take crude oil as an example.data range is 2013/7/10-2022/10/13,That's a total of nine years, three months and three days.

1. According to code, avg. trades per year = # of trads/total data years, Is this calculation appropriate? However, Ret/dd ratio per year(custom metric)=Ret/DD ratio/total trading years.
2. What is the difference between total data and total trading? Does it mean rounding? One is small and the other is big?
3. Because there are always some test cases, the start time of the data is not necessarily January 1 at the beginning of the year, and the end time of the data is not necessarily December 31 at the end of the year. Obviously, the calculation error of monthly metric is very small. But for all standardized annualized performence metric, such as avg. trades per year, ret/dd ratio per year and so on. Considering better universality of the calculation formula.Whether it should be calculated according to the actual  days and months of sample data converted into an annual number?  In fact, I think it's accurate enough to annualize it on a monthly basis.

AA
#5

Alex

26.11.2022 04:50
Voted for this task.
b
#6

binhsir

17.01.2023 08:06
i think total data years/months, total trading years/months should be double type, not should be integer. That may be calculated more accurately, and we can use standardized indicators for easily compare different strategies based on different symbols. For example, we know clearly 0.5 is benchmark of ret/dd ratio per year. We can make setting more conveniently in bulding strategies whatever total data years
b
#7

binhsir

17.01.2023 10:26
For any backtest time interval, the calculation method is generally suitable and accurate by converting the number of trading months or even the number of trading days into the total number of years or total months of trading (of course that is double data type).
b
#8

bentra

17.01.2023 19:45
TT
#9

Tamas

10.02.2023 09:04

Assignee changed from Mark Fric to Mark Fric

Status changed from New to Duplicate

Category changed from None to Backend

b
#10

binhsir

19.03.2023 13:53
It is considered that the time range of the full sample data and IS , OOS, Potfolio are arbitrary.  It is better to compute TotalDataYears and TotalDataMonths according to TotalDataDays. TotalDataYears and TotalDataMonth after conversion should be double type. inculding full sample, IS, OOS, Portfolio.  Then CAGR, Annual % return will be calculated more accurately, no matter what range of sample data we choose. Hopefully this will be fixed soon.

Votes: +3

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please