I always wondered about "ALgLIB in MQL" - how close it is to the original and corresponds to it?
Understand correctly, the worst thing that can happen is to get different results using AlgLIB for example in C/C++ and in MQL.
I always wondered about "ALgLIB in MQL" - how close it is to the original and corresponds to it?
Understand correctly, the worst thing that can happen is to get different results using AlgLIB for example in C/C++ and in MQL.
A few links to broaden your horizons.

the last two lines about test-case of the original AlgLIB. There are no tests in the MQL5 adaptation.
All extensive Alglib test-cases have always been from the very first ported version of the MQL5 library(October 2012):
\MQL5\Scripts\UnitTests\Alglib\ TestClasses.mq5 TestInterfaces.mq5 TestClasses.mqh TestInterfaces.mqh
Now it is 3,850 kb of tests in source code and 105,000 lines of code covering almost all functionality.
Anyone can compile the unit tests TestClasses.mq5 / TestInterfaces.mq5 and run them in the terminal.
- 2012.10.12
- www.mql5.com
In addition to Alglib, there are testcases for other maths libraries:

After the update the neural network stopped working.
I rolled back to the old version of ALGLIB. If you need it - attached.
Afternoon!
Has anyone been able to figure out how to use non-linear ISC optimisation ?
Here is an example from Alglib site https://www.alglib.net/translator/man/manual.cpp.html#example_lsfit_d_nlf
Could you please tell me what I'm doing wrong?
//+------------------------------------------------------------------+ //|Optim.mq5 | //|vp | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "vp" #property link "https://www.mql5.com" #property version "1.00" #include <Math\Alglib\alglib.mqh> void function_cx_1_func(double &c[],double &x[],double &func,CObject &obj) { // this callback calculates f(c,x)=exp(-c0*sqr(x0)) // where x is a position on X-axis and c is adjustable parameter func = MathExp(-c[0]*MathPow(x[0],2)); } void OnStart() { int info; CObject obj; vector v = {-1,-0.8,-0.6,-0.4,-0.2,0,0.2,0.4,0.6,0.8,1.0}; double y[] = {0.223130, 0.382893, 0.582748, 0.786628, 0.941765, 1.000000, 0.941765, 0.786628, 0.582748, 0.382893, 0.223130}; double c[] = {0.3}; CMatrixDouble x; x.Col(0,v); double epsx = 0.000001; int maxits = 0; double diffstep = 0.0001; // // Fitting without weights // CLSFitStateShell state; CAlglib::LSFitCreateF(x,y,c,diffstep,state); CAlglib::LSFitSetCond(state,epsx,maxits); CNDimensional_Rep rep; CNDimensional_PFunc function_cx_1_func; CAlglib::LSFitFit(state,function_cx_1_func,rep,0,obj); CLSFitReportShell grep; CAlglib::LSFitResults(state,info,c,grep); ArrayPrint(c); // EXPECTED: [1.5] Print(grep.GetIterationsCount()); Print(grep.GetRMSError()); }
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Check out the new article: ALGLIB numerical analysis library in MQL5.
The article takes a quick look at the ALGLIB 3.19 numerical analysis library, its applications and new algorithms that can improve the efficiency of financial data analysis.
Why choose ALGLIB when working with financial data?
Here are the key benefits of the library:
Besides, the library contains the large collection of test cases covering the major part of the proposed methods' functionality.
Author: MetaQuotes