What's that? By replacing the incorrects with the nearest corrections ??? I'm afraid it all depends on how we distribute those same incorrections. It's quite possible that the nearest corrections - will be away from the top.
And it will turn out that instead of wrong sets of parameters - we will have correct results - which also, in my opinion, should not be done - what do we find then? We'll get a maximum, and it will have an incorrect set of parameters ?
Honestly, I don't see a problem. However, my competence on the variant under discussion is zero.
No, the table with the correct chains will be considerably smaller, but even if there are 5000 of them, how do you spell them out and not get confused?
To a file dump. Then look up the pass number and match it to what is in the file.
Obviously if you trace a full enumeration of y = x^2. Then randomly shuffle the opimization rows and create a new set based on the shuffling. Then the GA will not find the vertex of the parabola.
Not more than a week ago I was banned for a similar thread for a moment and the thread/survey was ripped out as an unnecessary page with roots.
As for the question, I already wrote that it would be optimal to exclude all combinations that are forbidden, this can be optimally done by the developer, otherwise you need to make a script that runs through all combinations and saves only allowed combinations into a file, and already load that file for optimization using genetics.
Obviously, if you trace a complete enumeration of y = x^2. Then randomly shuffle the opimization strings and create a new set based on the shuffling. The GA will not find the top of the parabola.
I have created a test Expert Advisor for the optimizer's mat mode
// #define TESTER_FILE // Советник будет работать не только на локальных Агентах, но и в Облаке.#ifdef TESTER_FILE
// Нужно компилировать (не запускать) советник, когда этот файл (с любым содержанием, хоть пустой) лежит в Песочнице.// Иначе Тестер не будет видеть эти данные, даже если соответствующий файл с ними положить после компиляции на место. #property tester_file__FILE__constint FileCommon = 0;
#else
constint FileCommon = FILE_COMMON;
#endif // TESTER_FILEsinputbool Rand = false; // Вкл/выкл. перемешиваниеsinputint NumPass = 10001; // Количество проходов// Фитнесс-функцияdouble Func( constdouble X )
{
// return(X); // Проверка, что Агенты считывают нужные данныеreturn(-X * X + 1); // Парабола с максимальным значением в единице - его и будем искать
}
// Меняет местами элементы массиваtemplate <typename T>
void Swap( T &Array[], constuint Pos1, constuint Pos2 )
{
const T Tmp = Array[Pos1];
Array[Pos1] = Array[Pos2];
Array[Pos2] = Tmp;
}
// Возвращает случайный индекс массиваuint GetRandPos( constuint Size )
{
return(MathRand() * (Size - 1) / SHORT_MAX);
}
// Перемешивает элементы массиваtemplate <typename T>
void Mixing( T &Array[], constuint AmountIterations )
{
constint Size = ArraySize(Array);
MathSrand((uint)TimeLocal()); // Повторные запуски Оптимизатор будет игнорировать - build 1881for (uint i = 0; i < AmountIterations; i++)
Swap(Array, GetRandPos(Size), GetRandPos(Size));
}
// Вычисляет интервал оптимизацииvoid SetInterval( double &Array[], constdouble Begin, constdouble End, constuint Amount )
{
if (Amount > 1)
{
constdouble Step = (Begin - End) / (Amount - 1);
double Tmp = End;
for (int i = ArrayResize(Array, Amount) - 1; i >= 0; i--, Tmp += Step)
Array[i] = NormalizeDouble(Tmp, 8);
}
}
#define TOSTRING(A) #A
voidOnTesterInit()
{
ParameterSetRange(TOSTRING(NumPass), true, 0, 0, 1, NumPass - 1); // Задали Оптимизатору количество проходов = NumPassdouble Array[];
SetInterval(Array, -1, 1, NumPass); // Выстроили значения интервала по порядкуif (Rand)
Mixing(Array, NumPass * 10); // Перемешали все в интервале// ArrayPrint(Array); // Проверка, что Агенты считывают нужные данныеFileSave(__FILE__, Array, FileCommon); // Записали файл-интервал.А ведь так можно передать в Облако хоть содержимое всей Песочницы + полный стейтмент.
}
voidOnTesterDeinit()
{
if (FileCommon)
FileDelete(__FILE__, FileCommon); // Удалили файл-интервалChartClose(); // Закрыли чарт Frame-выполнения советника
}
doubleOnTester()
{
double Array[];
// Считали точку из интервала и вернули значение фитнесс-функции в нейreturn((FileLoad(__FILE__, Array, FileCommon) != -1) ? Func(Array[NumPass]): 0); // В режиме не-tester_file FileLoad будет выдавать ошибку, если два Агента одновременно обратятся.
}
I markedin red the vulnerabilities, weaknesses and current errors of MT5 that appeared while writing the example.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
What's that? By replacing the incorrects with the nearest corrections ??? I'm afraid it all depends on how we distribute those same incorrections. It's quite possible that the nearest corrections - will be away from the top.
And it will turn out that instead of wrong sets of parameters - we will have correct results - which also, in my opinion, should not be done - what do we find then? We'll get a maximum, and it will have an incorrect set of parameters ?
Honestly, I don't see a problem. However, my competence on the variant under discussion is zero.
I think @Andrey Dik can help on these issues. But even constructive criticism of the regular GA didn't end well for him...
Banned, unfortunately. Sending rays of unbanning to the administration, well, how much longer can you?
How about writing a function that only outputs valid chains by number ?
The first thing that comes to mind is a table of 117649 values, and let genetics look for numbers in this table.
No, the table with valid chains would be much smaller, but even if there are 5000 of them, how can we write them and not get confused?
No, the table with the correct chains will be considerably smaller, but even if there are 5000 of them, how do you spell them out and not get confused?
To a file dump. Then look up the pass number and match it to what is in the file.
Into the file reset. Then see the pass number and match it to what is in the file.
I meant how not to confuse, not to repeat, not to miss during the prescription process itself?
I meant how not to confuse, not to repeat, not to miss in the process of prescription itself?
In this example, the result will strongly depend on the order in which the for loops are placed. All because of this peculiarity.
Forum on trading, automated trading systems and strategy testing
Not for MT Developers! What to replace INIT_PARAMETERS_INCORRECT with ?
fxsaber, 2018.07.10 16:27
Obviously if you trace a full enumeration of y = x^2. Then randomly shuffle the opimization rows and create a new set based on the shuffling. Then the GA will not find the vertex of the parabola.
Not more than a week ago I was banned for a similar thread for a moment and the thread/survey was ripped out as an unnecessary page with roots.
As for the question, I already wrote that it would be optimal to exclude all combinations that are forbidden, this can be optimally done by the developer, otherwise you need to make a script that runs through all combinations and saves only allowed combinations into a file, and already load that file for optimization using genetics.
I'm inclined to conclude that the author's problem is with the architecture of his program.
Thanks for your opinion, but there's no discussion here about the architecture of the programme. In case you haven't noticed...
Obviously, if you trace a complete enumeration of y = x^2. Then randomly shuffle the opimization strings and create a new set based on the shuffling. The GA will not find the top of the parabola.
I have created a test Expert Advisor for the optimizer's mat mode
I markedin red the vulnerabilities, weaknesses and current errors of MT5 that appeared while writing the example.