You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Did I understand correctly that Sharpe.mqh only calculates the annual Sharpe ratio? Monthly Sortino will not work?
The article contains the answer to your question.
Again, what is a "low number"? Seems to me that 70-80 is low, but you don't have a penalty on such passes.
Are the numbers compared to other passes?
Is it normalised by the length of the test interval?
Most likely some fixed value is set, otherwise you would have to recalculate the whole table of results many times.
I agree with your arguments above.
They coincide, but not always
If you set the weekly timeframe in the tester, they almost always do not match:
On the monthly timeframe, the spread is even greater:
The article contains the answer to your question.
I did not find the answer to my question in the article, but judging by the code Sharpe.mqh Sortino is not in it. That's why I've attached the amended code with the Sortino calculation option below. At the same time I have optimised the code in terms of unnecessary function calls.
In my opinion, the disadvantage of the Sortino coefficient is that only yields below the risk-free rate (zero in this case) are taken for its calculation. But a positive return on one of the periods below the calculated average for the tested strategy is also a risk. That's why I added a coefficient calculation that takes into account only returns below the average. I haven't found an analogue, so I modestly named it Titov's coefficient)). When I find it, I will rename it.
In the original, it is inconvenient that the calculation period depends on the current timeframe. That's why I added setting the calculation period (if it is not explicitly set, the current timeframe is taken):
Returns.SetTF(PERIOD_MN1);I have not found in any source the necessity to use the logarithm of the yield when calculating the Sharpe ratio and bring it to the annual value. Therefore, I added the possibility to disable these options.
For some reason, the article's examples ignore periods with zero returns. This distorts the result. Therefore, I added an option to include such periods in the calculation.
Example of using the Sharpe ratio calculation as in the original:
Example of calculation of Sortino coefficient with all other things being equal:
For myself, I decided to assess the risk of below-average returns on monthly intervals:
I haven't found in any source the need to use the logarithm of returns when calculating the Sharpe ratio
To answer with a quote
I would add - try it without logarithms and tell me about the unusual side effect. You should encounter it.
I have not found in any source the necessity of calculating the Sharpe ratio and bringing it to an annualised value.
Another quote
As for bringing the Sharpe ratio to an annualised value, this is done to standardise the ratio to allow comparison between different investment strategies and portfolios, regardless of the original time scale of the investment. This is a common practice that helps investors measure investment performance against a common standard, especially when comparisons are made between different asset types or strategies with different trading frequencies
I'll respond with a quote
By sources, I meant information on Sharpe and Sortino ratios outside of this article.
As for bringing the Sharpe ratio to an annualised value, this is done to standardise the ratio, allowing it to be compared between different investment strategies and portfolios, regardless of the original time scale of the investment.
try it without logarithms and tell me about the unusual side effect. You should encounter it
I tried it: nothing unusual. But I found one mistake, I attach the corrected version.
I'll respond with a quote
I'll add for myself - try it without logarithms and tell me later about the unusual side-effect. You should encounter it.
Curiously, for such equity this script gives a Sharpe of 2.08:
And for this one (the same with reinvestment) 3.66:
Although it is obvious that the quality of the 2nd equity is worse (reinvest always worsens the quality of equity).
And if instead of logarithms of equity increments we use the increments themselves:
We get 3.85 for the first and 2.1 for the second. Much more adequate.
Sharpe on logarithms does not depend on the deposit size only in case of trading with reinvestment.
But in this case the Sharpe on simple increments does not depend on the deposit size.
Therefore, I don't understand why I should use Sharpe on logarithms.