ITComplex
- ライブラリ
-
Ivan Titov
Products:
✔️ITComlex - Use the MT5 Complex Criterion in your testing and optimization algorithm! https://www.mql5.com/en/market/product/211700 - バージョン: 1.0
- アクティベーション: 10
Need to calculate the MT5 Complex Criterion outside the Strategy Tester, e.g., for EA auto-optimization? ITComplex is exactly what you need! No more, no less.
The ITComplex library provides a calculation of the Complex Criterion that is as close as possible to the one built into MT5.
To use the library, include the following snippet at the beginning of your code:
#import "ITComplex.ex5" double GetComplex(double profit, int trades, int profitTrades, double profitFactor, double drawdownPercent, double recoveryFactor, double expectedPayoff, double sharpeRatio); #import
Usage example. To verify that the calculation matches the built-in Complex Criterion, insert the following code into your EA:
double OnTester() { double compl = GetComplex(TesterStatistics(STAT_PROFIT), (int)TesterStatistics(STAT_TRADES), (int)TesterStatistics(STAT_PROFIT_TRADES), TesterStatistics(STAT_PROFIT_FACTOR), TesterStatistics(STAT_EQUITYDD_PERCENT), TesterStatistics(STAT_RECOVERY_FACTOR), TesterStatistics(STAT_EXPECTED_PAYOFF), TesterStatistics(STAT_SHARPE_RATIO)); return MathAbs(compl - TesterStatistics(STAT_COMPLEX_CRITERION)); }
Next, run optimization using the Custom max criterion. The Result column will show all zeros, which means the calculations are identical. You can now confidently use the library in your own optimization algorithms anywhere - not just within OnTester()!
