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
Read the logarithm of price
You'll find other references yourself
Read the logarithm of price
You'll find other references yourself
Another extremely important nuance is that in this script, only those bars where there was a change in equity are taken into account in the calculation of the Sharpe:
//--- add only if equity has changed if(m_equities[i] != prev_equity) { log_return = MathLog(m_equities[i] / prev_equity); // increment logarithm aver += log_return; // average logarithm of increments AddReturn(log_return); // fill the array of incremental logarithms counter++; // counter of returns } prev_equity = m_equities[i];The average change is then found by dividing by the number of such bars:
However, the transition to the annual sharps is based on the timeframe ratio, as if all bars of the current tf were counted in the calculation:
I.e., once again: the script finds the averaged sharps per 1 bar with equity change, and then, to find the annual one, multiplies it not by the number of such bars in a year, but by the total number of bars of this tf in a year (its root, of course). Which is erroneous and overestimates the final figure.
Apparently, the Sharpe is calculated in the same way in the tester?
the script finds the average Sharpe per 1 bar with equity change, and then, to find the annual one, multiplies it not by the number of such bars in a year, but by the total number of bars of this tf in a year (its root, of course). Which is erroneous and overestimates the final figure
I also noticed that. That's why in my version I added an option to take into account zero bars.