What is the maximum number of user variables in the expert Advisor settings supported by MQL5?I want to create a multi-currency expert Advisor that works on 52 currency pairs.
Each currency pair has 45 settings and another 65 General settings of the expert Advisor. The total is 52×45 + 65 = 2405 settings.
Won’t MQL5 bend from so many settings?
Or has MQL5 not advanced that much yet and is left with a restrictive rudiment of 1280 user variables?
223231
Yes, manually. If only filling in the settings separates you from the profit, then you can suffer inconvenience. The indicators are not there, in the form in which you represent.If I need a setting, I just add it, it helps a lot. Naturally, there is no point in optimizing all this, I strive to get away from fitting for Istria, so that you can run on any tool and everything works stably in plus, for this there are so many settings. Yes, and there are many functions and all the necessary ones)
savinkins
Thanks, with ini it is clear. This is a regular file in any format, where you can save settings and read them. I thought there were standard mechanisms in which the tester automatically picks up the ini file, hence the question was.
prostotrader
long test_1, test_2, test_3;
//+------------------------------------------------------------------+
//| Expert Save settings function |
//+------------------------------------------------------------------+
void SaveSettings()
{
string file_name = Symbol() + ".dat";
int file_handle;
file_handle = FileOpen(file_name, FILE_WRITE|FILE_BIN);
if(file_handle != INVALID_HANDLE)
{
if(FileSeek(file_handle, 0, SEEK_CUR) == true)
{
FileWriteLong(file_handle, test_1);
FileWriteLong(file_handle, test_2);
FileWriteLong(file_handle, test_3);
}
FileClose(file_handle);
}
}
//+------------------------------------------------------------------+
//| Expert Load setings function |
//+------------------------------------------------------------------+
void LoadSettings()
{
string file_name = Symbol() + ".dat";
int file_handle;
if(FileIsExist(file_name, 0))
{
file_handle = FileOpen(file_name, FILE_READ|FILE_BIN);
if(file_handle != INVALID_HANDLE)
{
test_1 = FileReadLong(file_handle);
test_2 = FileReadLong(file_handle);
test_3 = FileReadLong( file_handle );
FileClose(file_handle);
}
}
jet4fly
why .ini? I record and store the EA settings in .set files.
If the settings are recorded in. ini files, then how to optimize the parameters of the expert Advisor?
laryx
Yes, I join the question – I have up to six settings for each pair, and I think this is too much. And here-two and a half thousand !!!
svalex
Do you manually configure all 2500 settings for each pair? I can’t even imagine what you can configure there in such a huge volume. Did you put all the available indicators into one expert Advisor at once?
andreykrivcov
May the gods of the forum forgive me, but guys, this is crazy… Don’t do that(((
223231
I have 28 pairs and 2500 settings in the robot, it works fine on real and demo, but there is a limit in the tester, in my opinion 1024 settings. I had to bypass this restriction through a file. That is, you can put these settings there and test them, but you will have to invent them.
savinkins
How do I write an ini file? Where should it be stored and what is its structure?
laryx
Can you imagine adding so many settings to the expert Advisor at launch ? (I’m not saying that when there are so many settings – 45 for a couple – then you are very likely to get a strong “adjustment to the curve”).
Isn’t it easier to make an ini file in which all these settings are written ?
Personally, I-in General, all the settings of each pair are prescribed directly in the expert code.