#property copyright"Copyright 2014, MetaQuotes Software Corp."#property link"https://www.mql5.com"#property version"1.00"#property strict//--- параметры для записи данных в файл//+------------------------------------------------------------------+//| Script program start function |//+------------------------------------------------------------------+string InpFileName="";
int t=0;
int file_handle=-2;
double mass[];
intOnInit()
{
Comment("Start");
InpFileName=StringConcatenate(WindowExpertName(),".csv"); // Имя файла ResetLastError();
file_handle=FileOpen(WindowExpertName()+"//"+InpFileName,FILE_READ|FILE_WRITE|FILE_CSV);
return(INIT_SUCCEEDED);
}
voidOnTick()
{
Comment(t);
if(file_handle!=INVALID_HANDLE)
{
t++;
ArrayResize(mass,t+1,10000);
mass[t]=Ask;
//--- запишем время сигналов и их значения в файлfor(int i=0; i<ArraySize(mass); i++)
FileWrite(file_handle,mass[t]);
//--- закрываем файлFileClose(file_handle);
}
elsePrintFormat("Не удалось открыть файл %s, Код ошибки = %d",InpFileName,GetLastError());
}
//+------------------------------------------------------------------+
I can't figure out how to write to the next line...
I'm trying to write each quote on a new line and it's not working ....
I am testing an EA with a custom indicator. Sometimes trades are opened in accordance with the conditions, and other times it is not clear on what principle. I start visualization, the indicator is drawn as it should be, but deals do not always coincide with the indicator. I tried to check the problematic areas with the alerts, but the indicator in the Expert Advisor shows zeros as well. I do not understand what the problem is, if the indicator is drawn correctly when testing, where are the indicator values passed to the EA?
The code is in the Expert Advisor:
double line=iCustom(NULL,0,"Ttest3",Period_MA_1,p2,p3,p4,1,1);
if (line >0){Opn_B=true;}
if (line <=0){Cls_B=true;}
I am testing an EA with a custom indicator. Sometimes trades are opened in accordance with the conditions, and other times it is not clear on what principle. I start visualization, the indicator is drawn as it should be, but deals do not always coincide with the indicator. I tried to check the problematic areas with the alerts, but the indicator in the Expert Advisor shows zeros as well. I do not understand what the problem is, if the indicator is drawn correctly during the test, where are the indicator values passed to the Expert Advisor?
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.
How do I declare my optimization criterion in 610 build, on my old EA?
The Expert Advisor is running on the 610 build.
For example, on MQL5 the code is as follows:
If I place it on Expert Advisor before it starts, Custom column does not appear.
And the second question: Old EAs show a yellow message during compilation: function must return a value.
Example line.
I can't figure out how to write to the next line...
I'm trying to write each quote on a new line and it's not working ....
I am testing an EA with a custom indicator. Sometimes trades are opened in accordance with the conditions, and other times it is not clear on what principle. I start visualization, the indicator is drawn as it should be, but deals do not always coincide with the indicator. I tried to check the problematic areas with the alerts, but the indicator in the Expert Advisor shows zeros as well. I do not understand what the problem is, if the indicator is drawn correctly when testing, where are the indicator values passed to the EA?
The code is in the Expert Advisor:I can't figure out how to write to the next line...
I'm trying to write each quote on a new line and it's not working ....
FileSeek
I am testing an EA with a custom indicator. Sometimes trades are opened in accordance with the conditions, and other times it is not clear on what principle. I start visualization, the indicator is drawn as it should be, but deals do not always coincide with the indicator. I tried to check the problematic areas with the alerts, but the indicator in the Expert Advisor shows zeros as well. I do not understand what the problem is, if the indicator is drawn correctly during the test, where are the indicator values passed to the Expert Advisor?
The code is in the Expert Advisor:maybe the problem is in the EA?
maybe the problem is with the advisor?
An error has occurred that I don't understand:
in the line:
return (li_cnt);this line is in the function:
Variable li_cnt is declared as seen. The compiler swears that it's not declared. What does this mean?An error has occurred that I don't understand:
in the line:
this line is in the function:
Variable li_cnt is declared as seen. The compiler swears that it's not declared. What does this mean?An error has occurred that I don't understand:
in the line:
this line is in the function:
Variable li_cnt is declared as seen. The compiler swears that it's not declared. What does this mean?AlexeyVik, Vladon,
Yes, as is usually the case, it's quite obvious. It's either my inattention or overwork. Thanks for the tip.
Another error has occurred, not even an error, but a warning in the function:
On the line:
The code seems to be fine. Should these warnings be ignored?