Discussion of article "Custom presentation of trading history and creation of report diagrams" - page 2

 
Aleksey Vyazmikin:

Maybe I'm not explaining it in the right way, the file "dealHistory.csv" was downloaded with the archive, it already contains data, I understand that the report will be built on them. How can I make the report build on my data?

Now I understand you. You run both tests. In the script that I have attached there are two tests, the first - the data is taken from the file. The second - the data is taken from the terminal on your history.

 
Andrey Azatskiy:

I see what you mean. You run both tests. In the script that I have attached there are two tests, the first - the data is taken from the file. The second - the data is taken from the terminal by your history.

And how do you switch between them?

 
You need the second test. In general, you can write your own test. DealHistoryGetter.mqh file creates a history report and ReportGetter.mqh file calculates the described indicators in the article.
I have modified these files a bit and now I am writing the second article, where I will attach a new version of these classes, where I have included more indicators and improved the code a bit.
 
Aleksey Vyazmikin:

And how to switch them?

I have not implemented switching, the test script first builds history tests from the file, and then repeats history tests from the terminal. Either to manually zonate unnecessary, or to write your own test. Or specify the path to the test file with the recorded history and go through all the tests (my history and yours)

 
Andrey Azatskiy:
You need the second test. In general, you can write your own test. DealHistoryGetter.mqh file creates a history report and ReportGetter.mqh file calculates the described indicators in the article.
I have modified these files a bit and now I am writing the second article, where I will attach a new version of these classes, where I have included more indicators and improved the code a bit.

Is it enough to comment out the second test?

//void test_1(string pathToFile_historyData);
void test_2(string pathToDir);

I have changed the paths to the files

//input string data_file_name ="C:\\MQL5 history saving test\\\dealHistory.csv"; // path to CSV file with history
input string data_file_name ="C:\Program Files\ Opening Broker\MQL5\Files\dealHistory.csv";    // path to CSV file with history
//input string report1_folder_name ="C:\\MQL5 test_1 to save report"; // folder for uploading the results of test #1
//input string report2_folder_name ="C:\\MQL5 test_2 to save the report"; // folder for uploading the results of test #2
input string report1_folder_name ="C:\Program Files\ Opening Broker\MQL5\Files\1";                // folder for uploading the results of test #1
input string report2_folder_name ="C:\Program Files\ Opening Broker\MQL5\Files\2";                // folder for uploading the results of test #2

As a result, I get errors:

2018.09.01 18:48:38.386 Get_TradingHistory (GAZR Splice,H1)     Failed FindFirstFile ("C:\Program Files\Открытие Брокер\MQL5\Files ") with error: 7b
2018.09.01 18:48:38.386 Get_TradingHistory (GAZR Splice,H1)     Failed CreateDirectoryW ("C:\Program Files\Открытие Брокер\MQL5\Files ") with error: 7b
2018.09.01 18:48:38.391 Get_TradingHistory (GAZR Splice,H1)     Error CopyFile C:\Users\***\AppData\Roaming\MetaQuotes\Terminal\Common\Files\temp.csv to C:\Program Files\Открытие Брокер\MQL5\Files \Графики PL.csv
2018.09.01 18:48:38.394 Get_TradingHistory (GAZR Splice,H1)     Error CopyFile C:\Users\***\AppData\Roaming\MetaQuotes\Terminal\Common\Files\temp.csv to C:\Program Files\Открытие Брокер\MQL5\Files \Гистограмма PL.csv
2018.09.01 18:48:38.395 Get_TradingHistory (GAZR Splice,H1)     Error CopyFile C:\Users\***\AppData\Roaming\MetaQuotes\Terminal\Common\Files\temp.csv to C:\Program Files\Открытие Брокер\MQL5\Files \PL по дням.csv
2018.09.01 18:48:38.396 Get_TradingHistory (GAZR Splice,H1)     Error CopyFile C:\Users\***\AppData\Roaming\MetaQuotes\Terminal\Common\Files\temp.csv to C:\Program Files\Открытие Брокер\MQL5\Files \Крайние точки.csv
2018.09.01 18:48:38.397 Get_TradingHistory (GAZR Splice,H1)     Error CopyFile C:\Users\***\AppData\Roaming\MetaQuotes\Terminal\Common\Files\temp.csv to C:\Program Files\Открытие Брокер\MQL5\Files \Абсолютные показатели прибыли и убытка.csv
2018.09.01 18:48:38.398 Get_TradingHistory (GAZR Splice,H1)     Error CopyFile C:\Users\***\AppData\Roaming\MetaQuotes\Terminal\Common\Files\temp.csv to C:\Program Files\Открытие Брокер\MQL5\Files \Проценты кол-ва сделок.csv
2018.09.01 18:48:38.399 Get_TradingHistory (GAZR Splice,H1)     Error CopyFile C:\Users\***\AppData\Roaming\MetaQuotes\Terminal\Common\Files\temp.csv to C:\Program Files\Открытие Брокер\MQL5\Files \Таблица основных показателей.csv
2018.09.01 18:48:38.400 Get_TradingHistory (GAZR Splice,H1)     Error CopyFile C:\Users\***\AppData\Roaming\MetaQuotes\Terminal\Common\Files\temp.csv to C:\Program Files\Открытие Брокер\MQL5\Files \Краткая сводка по графику PL.csv
2018.09.01 18:48:38.436 Get_TradingHistory (GAZR Splice,H1)     An error occurred while test_11 !
2018.09.01 18:49:29.246 Get_TradingHistory (GAZR Splice,H1)     zero divide in 'DealHistoryGetter.mqh' (432,60)
 
Aleksey Vyazmikin:

To enable the second test, a comment is sufficient to enable the second test?

I have changed the file paths

I end up getting errors:

Yes, if you comment out test_1(data_file_name,report1_folder_name); only the second test will be run.

1) Well, it works to open the file with the attached history on the path"C:\Program Files/open Broker\MQL5\Files " - Either the rights or because the space was blocked, you seem to be able to open the folder as a file.
2) Well, it works to create a directory on the path you passed
3) It does not work to create csv files on the path you passed
4) Division by zero (but it can't be if the history was opened correctly, because at the first iteration of the Array with lots the first value is entered into the Array with lots).


I can advise you to change the directory with files to the desktop for example.

 
And by the way, when passing a path, backslash should be escaped (write \\\).
 

I've corrected the paths

//input string data_file_name ="C:\\MQL5 history saving test\\\dealHistory.csv"; // path to CSV file with history
input string data_file_name ="C:{\Program Files}{\Program Files} {\Opening Broker\\MQL5\Files\dealHistory.csv}";    // path to CSV file with history
//input string report1_folder_name ="C:\\MQL5 test_1 to save report"; // folder for uploading the results of test #1
//input string report2_folder_name ="C:\\MQL5 test_2 to save the report"; // folder for uploading the results of test #2
input string report1_folder_name ="C:{\Program Files}{\Program Files} {\Opening Broker\\MQL5\Files\1}";                // folder for uploading the results of test #1
input string report2_folder_name ="C:{\Program Files}{\Program Files} {\Opening Broker\\MQL5\Files\2}";                // folder for uploading the results of test #2

The following errors remain

2018.09.01 18:59:09.799 Get_TradingHistory (GAZR Splice,H1)     An error occurred while test_11 !
2018.09.01 19:00:01.201 Get_TradingHistory (GAZR Splice,H1)     zero divide in 'DealHistoryGetter.mqh' (432,60)

There are files in folder 1(report1_folder_name), but nothing in folder 2. There is no summary report, by the way, in which folder should I look for it? On the chart I see how different charts are built, but where these pictures are placed I don't understand....

What else can I fix?

 
Aleksey Vyazmikin:

I corrected the paths

These errors remain

There are files in folder 1(report1_folder_name), but nothing in folder 2. There is no summary report, by the way, in which folder should I look for it? I can see how different graphs are built on the chart, but I don't understand where these pictures are placed....

What else can I fix?

Try replacing the DealHistoryGetter.mqh file with the one attached to this message.

Files:
 
Let me know how it turns out