3. In OnDeinit I insert this from the 2nd script from here: https://www.mql5.com/ru/code/27611:
uchar Bytes2[];
if (MTTESTER::GetLastTstCache(Bytes2) != -1) // If it was possible to read the last cache record of a single run
{
const SINGLETESTERCACHE SingleTesterCache(Bytes2); // Drive it into the corresponding object.
SingleTesterCache.SaveSet(NULL, true, "Created by " + __FILE__); // Save the set file with details.double Balance[];
double Equity[];
Print(SingleTesterCache.Header.ToString()); // Output the header of a single pass.Print(SingleTesterCache.Summary.ToString()); // Statistica.Print(SingleTesterCache.Inputs); // Input parameters.
I'd rather have the files ready to go. And I don't understand what you need to get.
Yes, I wanted to get the statistics of the last single run and write it to a file, for example, as you wrote here in the multitester topic. https://www.mql5.com/ru/forum/318305/page23#comment_19934192.
Yes, I wanted to pull out the statistics of the last single run and write it to a file, for example, as you wrote here in the multitester topic. https://www.mql5.com/ru/forum/318305/page23#comment_19934192
I guess you could try running the examples from the delivery or discussions.
I haven't found such functionality or something similar to record pass statistics in csv file yet. Hmm, even in libraries I have not found suitable functions. I will look for more.
I see such a block, but how to call the necessary information from it I did not understand
Every time I look at my code as if it were someone else's - I stupidly don't remember it at all.
That's why I can't tell you.
I see, so the more you study, the more you understand. It's just that as I understand, not all functionality can be included in the current version of the library, that is, something may be missing to fulfil the task. The main thing is to understand whether it is possible or not)
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.
2 issue.
Print(SingleTesterCache.Summary.ToString()) command;
I tested it in other Expert Advisors etc. and it gives out some wrong statistics.
variant 1
option 2
2 problem.
Forum on trading, automated trading systems and testing trading strategies
Errors, bugs, questions
Renat Fatkhullin, 2021.01.01 00:14
Perhaps I assume that it does not work because of the reason of incorrect code transfer from the script to the Expert Advisor.
I will send you an example.
Procedure.
1. Any Expert Advisor is taken - I have tested repeatedly on the standard Movin' Averag.
2. I put inclusions at the top:
3. In OnDeinit I insert this from the 2nd script from here: https://www.mql5.com/ru/code/27611:
3.2 I tried the same "sort of" in this form
const SINGLETESTERCACHE SingleTesterCache; // Загоняем ее в соответствующий объект. double Balance[]; double Equity[]; Print(SingleTesterCache.Header.ToString()); // Вывели заголовок одиночного прохода. Print(SingleTesterCache.Summary.ToString()); // Статистику. Print(SingleTesterCache.Summary.ToString()); // Статистику. Print(SingleTesterCache.Inputs); // Входные параметры.Perhaps I assume that it does not work because of the reason of incorrect code transfer from the script to the Expert Advisor.
I will send an example now.
It would be better with ready files. I don't understand what you need to get.
I'd rather have the files ready to go. And I don't understand what you need to get.
Yes, I wanted to get the statistics of the last single run and write it to a file, for example, as you wrote here in the multitester topic. https://www.mql5.com/ru/forum/318305/page23#comment_19934192.
To do without inserting code in OnDeinit EA everywhere.
In fact, not even all statistics are needed, but a few parameters. For example, MQLInfoString(MQL_PROGRAM_NAME),TesterStatistics(STAT_SHARPE_RATIO).
Yes, I wanted to pull out the statistics of the last single run and write it to a file, for example, as you wrote here in the multitester topic. https://www.mql5.com/ru/forum/318305/page23#comment_19934192
To avoid inserting code in OnDeinit EA everywhere.
In fact, not even all statistics are needed, but a few parameters. For example, MQLInfoString(MQL_PROGRAM_NAME),TesterStatistics(STAT_SHARPE_RATIO).
Probably, you can try to run examples from the delivery or discussions.
I guess you could try running the examples from the delivery or discussions.
I haven't found such functionality or something similar to record pass statistics in csv file yet. Hmm, even in libraries I have not found suitable functions. I will look for more.
I see such a block, but how to call the necessary information from it I did not understand
string ToString( void ) const
{
return(this.Header.expert_path[] + "\n; " +
this.Header.symbol[] + "\n; " +
::TimeToString(this.Header.date_from, TIME_DATE) + " - " + ::TimeToString(this.Header.date_to, TIME_DATE) + "\n; " +
::DoubleToString(this.Summary.TesterStatistics(STAT_PROFIT), 0) + ", " + " +
::DoubleToString(this.Summary.TesterStatistics(STAT_TRADES), 0) + ", " + ::DoubleToString(this.Summary.TesterStatistics(STAT_TRADES), 0) + ", " +
::DoubleToString(this.Summary.TesterStatistics(STAT_PROFIT_FACTOR), 2) + ", " + ::DoubleToString(this.Summary.TesterStatistics(STAT_PROFIT_FACTOR), 2) + ", " +
::DoubleToString(this.Summary.TesterStatistics(STAT_EXPECTED_PAYOFF), 2) + ", -" + ::DoubleToString(this.Summary.TesterStatistics(STAT_EXPECTED_PAYOFF), 2) + ", -" +
::DoubleToString(this.Summary.TesterStatistics(STAT_EQUITY_DD), 2));
}
I see such a block, but I don't understand how to call the required information from it
Every time I look at my code as if it were someone else's, I just don't remember it at all.
That's why I can't give you a hint.
Every time I look at my code as if it were someone else's - I stupidly don't remember it at all.
That's why I can't tell you.
I see, so the more you study, the more you understand. It's just that as I understand, not all functionality can be included in the current version of the library, that is, something may be missing to fulfil the task. The main thing is to understand whether it is possible or not)
The main thing is to understand whether it's possible or not)
https://www.mql5.com/ru/code/viewcode/27611/229701/exptradesummarysingle.mqh