Hello,
I've been messing around a bit with some ratios, trying to come up with a way to optimize multiple criteria.
And here's the result:
I'm including 6 different criteria:
- Sharpe Ratio maximize
- Return/DD maximize
- Lowest Monthly Return maximize
- Winning Ratio maximize
- Stagnation (longest duration of a Drawdown period) minimize
- Avg Trade Duration (this is a personal preference) minimize
I apply different weights to different criteria (like for example I don't give much weight to the Winning Ratio, but still consider it), and I normalize all ratios to a (0,1) range using the Sigmoid function.
Now what I'm trying to achieve is to optimize the mean of the ratios, but also to have a low standard deviation:
for example a mean of 0.6 is better if the values were {0.58, 0.64, 0.57... the if they were {0.91, 0.18, 0.7....
How I tried to achieve that is by a dividing the mean by the standard deviation for the final OnTester result, but that was giving too much weight to the standard deviation, so I scaled it down.
But then also the ratio was penalizing positive peak scores, so I applied a "Sortino-like" idea, where then standard deviation is only calculated by taking into consideration downwards deviations below a defined minimum score of 0.6
Anyway, I would love to hear your thoughts for improving this thing, and maybe some different formulae to replace mean/standard deviation.
I have attached the full code so you could see all the referenced functions.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
I've been messing around a bit with some ratios, trying to come up with a way to optimize multiple criteria.
And here's the result:
I'm including 6 different criteria:
I apply different weights to different criteria (like for example I don't give much weight to the Winning Ratio, but still consider it), and I normalize all ratios to a (0,1) range using the Sigmoid function.
Now what I'm trying to achieve is to optimize the mean of the ratios, but also to have a low standard deviation:
for example a mean of 0.6 is better if the values were {0.58, 0.64, 0.57... the if they were {0.91, 0.18, 0.7....
How I tried to achieve that is by a dividing the mean by the standard deviation for the final OnTester result, but that was giving too much weight to the standard deviation, so I scaled it down.
But then also the ratio was penalizing positive peak scores, so I applied a "Sortino-like" idea, where then standard deviation is only calculated by taking into consideration downwards deviations below a defined minimum score of 0.6
Anyway, I would love to hear your thoughts for improving this thing, and maybe some different formulae to replace mean/standard deviation.
I have attached the full code so you could see all the referenced functions.