Valeriy Yastremskiy multidimensional arrays can be initialized with the function
ArrayInitialize(array,EMPTY_VALUE); Like this double msArr[10][4][500]; Or it can only be done in loop in MKL4.
There are also ArrayFill and ZeroMemory
Multidimensional array when processing with ArrayFill() appears as one-dimensional, for example, array[2][4] is processed as array[8], so when working with this array it's acceptable to specify index of initial element equal to 5. So, call ArrayFill(array, 5, 2, 3.14) for array[2][4] will fill array[1][1] and array[1][2] with value 3.14.
And you're a joker. And the problem really is, and there are topics about that the command Print prints twice in the tab Experts and Allert also comes twice, only there is no answer alas how to fix it. And for the future, if you do not know, you can just keep silent and pass by, but to gain rating themselves unprofessional answers is stupid. Yes, by the way, your answers are really very weak.
You're a joker. But the problem is real, and there are topics about that the command Print prints twice in the tab Experts and Allert also comes twice, only there is no answer alas how to fix it. And for the future, if you do not know, you can just keep silent and pass by, but to gain rating themselves unprofessional answers is stupid. Yes, by the way, your answers are really very weak.
You didn't understand my link...
Print doesn't print more than once, if it does, there's an error in the code...that's why I sent you to the telepaths, as you haven't posted the code)
Dear forum users, I need some help. I wrote a script in MQL4 that draws a line by a formula from three given points on a chart. It takes 130 lines, including indents and spaces. I have recently decided to port it to MQL5 and realized that my poor knowledge in programming will not help me, I need to learn again.
I will be grateful if someone is ready to port the script to MQL5. I would be glad if somebody would like to port this script to MQL5.
#property copyright"ExpoMe"#property link"http://www.metaquotes.net"#property indicator_chart_window#property indicator_buffers1#property indicator_color1 Blue
#property indicator_width12#property indicator_style10double Buffer1[];
//+------------------------------------------------------------------+//| Объявляем внешние переменные |//+------------------------------------------------------------------+datetime point_1;
datetime point_2;
datetime point_3;
datetime LastBarTime;
string line_name[10];
int gg=1;
int x1;
int x2;
int x3;
int xx1; // В эту переменную сохраняется значение номера бара вершины перед прогоном при появлении нового бара.int xx2; // Если линии стоят, значит при поялвении нового бара номер бара вершины должен увеличиться на 1.int xx3; // Если этого не произошло и xx1=x1 после прогона, значит увеличиваем вручную.int max;
int maxx;
double y1;
double y2;
double y3;
double y11;
double y22;
double y33;
double x11;
double x22;
double x33;
double y;
double a1;
double a2;
double a3;
//+------------------------------------------------------------------+//| Custom indicator initialization function |//+------------------------------------------------------------------+int init()
{SetIndexBuffer(0,Buffer1);
SetIndexStyle(0,DRAW_LINE);
//---- indicators//----return(0);
}
int start()
{
// Пересчитываем инликатор только при появлении нового бараif(LastBarTime == iTime(Symbol(), 0, 0))
return(0);
LastBarTime = iTime(Symbol(), 0, 0);
// Присваиваем значения переменных времениint obj_total=ObjectsTotal();
for(int ii=0;ii<100;ii++)
{string name = ObjectName(ii);
if(ObjectType(name)!=OBJ_VLINE)
continue;
line_name[gg] = ObjectName(ii);
gg=gg+1;
}
point_1=ObjectGet(line_name[1], OBJPROP_TIME1);
point_2=ObjectGet(line_name[2], OBJPROP_TIME1);
point_3=ObjectGet(line_name[3], OBJPROP_TIME1);
// Запоминаем текущий номер бара вершины
xx1=x1;
//Определяем номера баров ключевых точекfor (int j=0;j<Bars; j++)
{ if (Time[j]==point_1) x1=j;}
// Если после прогона сдвиг по вершине не произошел, значит линий нет, добавляем +1 вручную.if (x1==xx1) x1=x1+1;
xx2=x2;
for (int k=0;k<Bars; k++)
{if (Time[k]==point_2) x2=k; }
if (x2==xx2) x2=x2+1;
xx3=x3;
for (int l=0;l<Bars; l++)
{if (Time[l]==point_3) x3=l; }
if (x3==xx3) x3=x3+1;
// Comment ("n1=", j," n2=", k, " n3=", l);//Находим "высоту" вершин
{
y1=High[x1];
y2=High[x2];
y3=High[x3];
//Comment ("y1=", y1," x1=", x1, " y2=", y2, "x2=", x2," y3=", y3, " x3=", x3);//Принимаем первую из них за начало координат
a1=(y3-(x3*(y2-y1)+x2*y1-x1*y2)/(x2-x1))/(x3*(x3-x1-x2)+x1*x2);
a2=((y2-y1)/(x2-x1))-a1*(x1+x2);
a3=((x2*y1-x1*y2)/(x2-x1))+a1*x1*x2;
max=MathMax(x1,x2);
maxx=MathMax(max,x3);
for (int i=maxx; i>=0; i--)
{ y=a1*i*i+a2*i+a3;
Buffer1[i]=y;}
return(0);
}}
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.
Read the rules. The EA should work without restrictions on both instruments and TFs.
Thank you! There were a lot of other errors in the process)
ArrayInitialize(array,EMPTY_VALUE);
Like this double msArr[10][4][500];
Or it can be done only in loop in MKL4.
ArrayInitialize(array,EMPTY_VALUE);
Like this double msArr[10][4][500];
Or it can only be done in loop in MKL4.
There are also ArrayFill and ZeroMemory
Multidimensional array when processing with ArrayFill() appears as one-dimensional, for example, array[2][4] is processed as array[8], so when working with this array it's acceptable to specify index of initial element equal to 5. So, call ArrayFill(array, 5, 2, 3.14) for array[2][4] will fill array[1][1] and array[1][2] with value 3.14.
There is also ArrayFill and ZeroMemory
This way!
And you're a joker. And the problem really is, and there are topics about that the command Print prints twice in the tab Experts and Allert also comes twice, only there is no answer alas how to fix it. And for the future, if you do not know, you can just keep silent and pass by, but to gain rating themselves unprofessional answers is stupid. Yes, by the way, your answers are really very weak.
You're a joker. But the problem is real, and there are topics about that the command Print prints twice in the tab Experts and Allert also comes twice, only there is no answer alas how to fix it. And for the future, if you do not know, you can just keep silent and pass by, but to gain rating themselves unprofessional answers is stupid. Yes, by the way, your answers are really very weak.
You didn't understand my link...
Print doesn't print more than once, if it does, there's an error in the code...that's why I sent you to the telepaths, as you haven't posted the code)
Good night!
Dear forum users, I need some help. I wrote a script in MQL4 that draws a line by a formula from three given points on a chart. It takes 130 lines, including indents and spaces. I have recently decided to port it to MQL5 and realized that my poor knowledge in programming will not help me, I need to learn again.
I will be grateful if someone is ready to port the script to MQL5. I would be glad if somebody would like to port this script to MQL5.
I would be glad if somebody would do it for free (with).
Throw the code in here, maybe someone will do it for free(c), it happens