Finding through iHighest and iLowest is not a problem. How to bake this into the tester so that it gives information on formation time, on a particular history.
Finding through iHighest and iLowest is not a problem. How to bake this into the tester so that it gives information on the time of formation, on a particular history.
Finding through iHighest and iLowest is not a problem. How to get this into the tester, so that it gives information on the time of formation, on a particular history.
How can I make the minimum and maximum times be displayed separately? Or rather, it is not a problem. There are several lines for each time in the logbook.
What could be the problem? How to make one line output per value. Ideally, you want a time in numbers that can be copied into excel and compared by
Again, my delete pending orders function does not delete everything. Moreover, it doesn't delete everything in the tester. Help me to understand what is wrong with it.
void DeletePendingOrders()
{
int numberOfTry = 0,
err,
ticket;
for (int i=OrdersTotal()-1; i>=0; i--)
{
if (!OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) continue;
if (OrderMagicNumber() != i_magic) continue;
if (OrderSymbol() != Symbol()) continue;
if (OrderType() > 1 && OrderType() < 6)
{
ticket = OrderTicket();
numberOfTry = 0;
while (numberOfTry < 3)
{
while (!IsTradeAllowed()) Sleep(5000);
err = 0;
if (OrderDelete(ticket, Red))
{
numberOfTry = 3;
}
else
{
err = GetLastError();
Print("err = ", err);
}
if (err > 0)
{
Print(numberOfTry," #",ticket," Error modifing order: (", err , ") ");
Sleep(5000); RefreshRates(); numberOfTry++;
}
}
}
}
}
How to make the minimum and maximum times to be output separately? More precisely, to do it separately is not a problem. The log shows several lines for each time.
What could be the problem? How to make one line output per value. Ideally, you want a time in numbers that can be copied into excel and compared by
and compare it by coincidence.
Here's the script, writes the data to a file. Extremes to the nearest minute for the whole story:
int start() {
int Handle=FileOpen("ScriptDayExtr",FILE_WRITE|FILE_CSV);
if(Handle<0) {Print("Ошибка создания файла"); return(0);}
datetime TimeMax,TimeMin;
double HistoryMaximum=0;
double HistoryMinimum=99999999.9;
int LastH=TimeHour(iTime(Symbol(),PERIOD_M1,0));
Print("Баров в истории ",iBars(Symbol(),PERIOD_M1)," т.е всего на ",DoubleToStr(iBars(Symbol(),PERIOD_M1)/60.0/24.0,2)," дней");
for (int i=iBars(Symbol(),PERIOD_M1)-1; i>=0; i--) {
if(iTime(Symbol(),PERIOD_M1,i)==0) {Print("ERROR");continue;}
int H=TimeHour(iTime(Symbol(),PERIOD_M1,i));
if(H<LastH && TimeMax>0){
FileWrite(Handle," Максимум=",DoubleToStr(HistoryMaximum,Digits)," случился в ",TimeToStr(TimeMax,TIME_DATE|TIME_MINUTES)," ",
" Минимум=",DoubleToStr(HistoryMinimum,Digits)," случился в ",TimeToStr(TimeMin,TIME_DATE|TIME_MINUTES));
HistoryMaximum=0;
HistoryMinimum=99999999999999.9;
}
LastH=H;
if( iHigh(Symbol(),PERIOD_M1,i)>HistoryMaximum) {HistoryMaximum=iHigh(Symbol(),PERIOD_M1,i);TimeMax=iTime(Symbol(),PERIOD_M1,i);}
if( iLow(Symbol(),PERIOD_M1,i)<HistoryMinimum) {HistoryMinimum=iLow (Symbol(),PERIOD_M1,i);TimeMin=iTime(Symbol(),PERIOD_M1,i);}
}
FileClose(Handle);
return(0);
}
And to make it in the tester - an indicator has to be written however.
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.
Can you tell me how to find the absolute maximum and minimum on the history with the strategy tester?
Maximum and minimum of what?
In the history of EURUSD, the maximum and minimum prices of the day. The time of their formation.
EURUSD history maximum and minimum prices for the day. The time of their formation.
Read iHighest and iLowest
Finding through iHighest and iLowest is not a problem. How to bake this into the tester so that it gives information on formation time, on a particular history.
Finding through iHighest and iLowest is not a problem. How to bake this into the tester so that it gives information on the time of formation, on a particular history.
You can try it this way:
Finding through iHighest and iLowest is not a problem. How to get this into the tester, so that it gives information on the time of formation, on a particular history.
You could try it this way:
How can I make the minimum and maximum times be displayed separately? Or rather, it is not a problem. There are several lines for each time in the logbook.
What could be the problem? How to make one line output per value. Ideally, you want a time in numbers that can be copied into excel and compared by
match.
Again, my delete pending orders function does not delete everything. Moreover, it doesn't delete everything in the tester. Help me to understand what is wrong with it.
How to make the minimum and maximum times to be output separately? More precisely, to do it separately is not a problem. The log shows several lines for each time.
What could be the problem? How to make one line output per value. Ideally, you want a time in numbers that can be copied into excel and compared by
and compare it by coincidence.
Here's the script, writes the data to a file. Extremes to the nearest minute for the whole story:
And to make it in the tester - an indicator has to be written however.