//+------------------------------------------------------------------+//| Main class to read opt-file and export it to CSVs |//+------------------------------------------------------------------+class OptReader
{
TesterOptCacheHeader header;
TestCacheInputExtended inputs[];
uchar bufferOfInputs[];
int shapshot[];
AutoPtr<RecordBase> records;
bool read(constint handle)
{
SAFE(FileReadStruct(handle, header));
if(header.parameters_total)
{
TestCacheInput temp[];
SAFE(FileReadArray(handle, temp, 0, header.parameters_total));
constint n = ArrayResize(inputs, header.parameters_total);
for(int i = 0; i < n; ++i)
{
inputs[i] = temp[i]; // cannot convert parameter 'TestCacheInput' to 'const TestCacheInputExtended&'
inputs[i].extend();
}
}
//+------------------------------------------------------------------+//| Input struct with stringified fields |//+------------------------------------------------------------------+struct TestCacheInputExtended: public TestCacheInput
{
using TestCacheInput::operator=;
Of course, MQL5 is constantly changing, and unfortunately MQ does this in a way which often breaks back-compatibility. I don't think this is a proper way of improving the platform, but anyway - the only thing we can do is to fix the problems by patches, according to new syntax. For example, in this case just add the single line:
struct MqlCalendarRecord: publicMqlCalendarValue
{
using MqlCalendarValue::operator=;
...
};
Just follow the official news about the changes in MQL5 syntax.
This is exactly what I needed.
Please, make sure you got the latest update, because you quoted not the most recent one published on this thread.
Please fix it.
Thank you. I fixed it a bit differently.
It's more convenient and logical, because extend() doesn't need to be explicitly called.
NB: the attached file contains other useful edits.
Thank you. Fixed it a little differently.
It's more convenient and logical, because extend() doesn't need to be explicitly called.
NB: the attached file contains other useful edits.
Forwarded from another Topic:
Forum on trading, automated trading systems and testing trading strategies
CalendarRecordById.mq5 - Errors
Ryan L Johnson, 2025.12.19 17:44
@MetaQuotes Support, the above referenced calendar indicator published in the MQL5 Book content appears to contain deprecated code.
The file is referenced at Reading event records by ID - Advanced language tools - MQL5 Programming for Traders.
The file, itself, is at: https://www.mql5.com/en/code/download/45596/CalendarRecordById.mq5.
Of course, you'll need to download the included library files to reproduce the issues.
Personally, I've used a workaround to get what I need in my code. My purpose here is to ensure that the documentation is kept current.
Forwarded from another Topic:
Of course, MQL5 is constantly changing, and unfortunately MQ does this in a way which often breaks back-compatibility. I don't think this is a proper way of improving the platform, but anyway - the only thing we can do is to fix the problems by patches, according to new syntax. For example, in this case just add the single line:
Just follow the official news about the changes in MQL5 syntax.