Sometimes it is necessary to view some piece of price history in the form of a table. This can be done via CTRL+U, selecting the Bars/Ticks tab. Entering the necessary interval there by hand. It is tedious.
That is why I created an additional functionality, which is demonstrated by the following Expert Advisor.
#include <fxsaber\MultiTester\MTTester.mqh> // https://www.mql5.com/en/code/26132#include <fxsaber\Keyboard\Keyboard.mqh> // https://www.mql5.com/en/code/48393inputbool inTicks = true; // true - Ticks, false - Barsinputint inBefore = -60; // Before in secondsinputint inAfter = 60; // After in secondsinputENUM_TIMEFRAMES inPeriod = PERIOD_CURRENT; // Period (Bars mode)datetime GetTime( constint X )
{
int Window;
datetime Res;
double Price;
return(ChartXYToTimePrice(0, X, 0, Window, Res, Price) ? Res : 0);
}
voidOnChartEvent( const int32_t id, constlong &lparam, constdouble&, conststring& )
{
if ((id == CHARTEVENT_CLICK) && KEYBOARD::IsControl())
{
constdatetime Time = GetTime((int)lparam);
if (Time)
{
if (inTicks)
MTTESTER::CopyTicks(_Symbol, Time + inBefore, Time + inAfter);elseMTTESTER::CopyRates(_Symbol, inPeriod, Time + inBefore, Time + inAfter);
}
}
}
You click (with CTRL pressed) on the necessary place of the chart and automatically get the corresponding tabular data at once.
Selected functions simply fill in certain data fields and query them. Then through the GUI you see what you were interested in. Automation, in general.
если бы время файлов в архиве совпадало со временем модификации в кодобазе. Не соответствует времени изменения конкретного файла. Я вижу корректную структуру после разархивирования а ведь сам редактор позволяет загрузить все эти файлы именно так
Good day, dear fxsaber! Please help me to solve a problem. My script has an archive function, which I developed with the help of the great MTTESTER library. It writes Settin to the Tester folder in the following line: if(!kernel32::CopyFileW(SrcPath,DstPath,false)) // Overwrite Settin from the Files sandbox to the Tester folder. We get a set with the name: "After archiving". But it is not suitable for further rework, apparently because of the encoding. However, if you manually write it to the robot in the Strategy Tester and then save it with the name "After manual writing to the robot and saving", this set is already suitable. And it's not just a matter of changing the header, but something else. I asked the ironmen (Qwen, Deep Seek) for help and they generated a script "ReloadSetsFromCommonFixed". It's got a lot of great features and it works, except for this line: if(!FileCopy(source_path, FILE_COMMON, dest_path, FILE_COMMON)) The set is copied, but then on verification printout the output is abracadabra, apparently due to encoding. Iron offered 4 solutions, but none of them worked (the text has all of them). My last hope is for leather ones. Is there any way to change this line in the archiving function: if(!kernel32::CopyFileW(SrcPath,DstPath,false)) to simulate also manual writing to the robot with subsequent saving in the required format "After manual writing to the robot and saving"? Regards, Alexander
prRead0 = MTTESTER::GetSettings(Control); // Reads the robot settings that were just installed
works correctly and prRead0 = true after its execution.
But in the Control network prMFI=true, as it was originally loaded manually into the robot. This means that the write to the robot did not actually happen, even though the write sign prWrite0 = true.
In the original network, prHEX=true
In the robot's original network prMFI=true
The MTTESTER::SetSettings2(Settings) command works, but these settings do not appear in the robot.
You can save(inLoad = false) a set-file through the script, then change somethingin it by hand and load(inLoad = true) it into the Tester through the script.
If it works, take the corresponding pieces of the source for yourself.
Sometimes it is necessary to view some piece of price history in the form of a table. This can be done via CTRL+U, selecting the Bars/Ticks tab. Entering the necessary interval there by hand. It is tedious.
That is why I created an additional functionality, which is demonstrated by the following Expert Advisor.
You click (with CTRL pressed) on the necessary place of the chart and automatically get the corresponding tabular data at once.
Selected functions simply fill in certain data fields and query them. Then through the GUI you see what you were interested in. Automation, in general.
5430 The windows still blink when preparing a task.
How do you fix this?
5430 Windows still blinks when preparing an assignment.
How do you fix this?
Thus.
It's a great theme. But I downloaded before everything separately still blinks.
I saw that in the file MultiTester_Example.mq5
added lines to the MultiTester_Example.mq5 file.
I have commented so or should I do it differently? Or can I delete all these 4 lines?
P.S. I saw that I took the old list of tasks without these lines and it flickered. With the new lines it doesn't blink.
But did I correctly comment out only 1 line?
It's a great theme. But I downloaded before that everything separately still blinks.
I saw that in the file MultiTester_Example.mq5
added lines
I have commented it this way or should I do it differently? Or can I delete all these 4 lines in general?
P.S. I saw that I took the old task list without these lines and it was blinking. With new lines it doesn't blink.
But have I commented only 1 line correctly?
Is there any way to change this line in the archiving function
I looked up here (in the opened window press ENTER in the address bar) the set record. Most likely these flags are needed.
These flags helped a lot and the archiving problem was solved. Now the result is in the right format.
Thank you very much!
But in my script Nocturne the command does not work correctly :
prWrite0 = MTTESTER::SetSettings2(Settings); // Write settings to the robot
Although prWrite0 = true after its execution.
Probably it's again a matter of flags when reading the Settings set from the folder.
This is done by the GetKthFileContent function, which has the line:
int handle = FileOpen(full_path, FILE_READ | FILE_WRITE | FILE_UNICODE | FILE_TXT | FILE_COMMON);
The variants of the line below don't work either:
// int handle = FileOpen(full_path, FILE_READ | FILE_TXT | FILE_COMMON); // Source variant line
// int handle = FileOpen(full_path, FILE_READ | FILE_UNICODE | FILE_TXT | FILE_COMMON);
Next command:
prRead0 = MTTESTER::GetSettings(Control); // Reads the robot settings that were just installed
works correctly and prRead0 = true after its execution.
But in the Control network prMFI=true, as it was originally loaded manually into the robot. This means that the write to the robot did not actually happen, even though the write sign prWrite0 = true.
In the original network, prHEX=true
In the robot's original network prMFI=true
The MTTESTER::SetSettings2(Settings) command works, but these settings do not appear in the robot.
What is the problem here?
Regards, Alexander
So what's the problem here?
I didn't bother with studying flags and decided to write a working code for saving and loading Tester set-files.
You can save(inLoad = false) a set-file through the script, then change somethingin it by hand and load(inLoad = true) it into the Tester through the script.
If it works, take the corresponding pieces of the source for yourself.