E_Ghazaryan: Yeah, right =D )))) Already attached.)))
All these parameters should be listed after comma in iCustom() after the indicator name, and after them two more parameters: buffer number and bar number, from which the data is taken. I.e:
All the listed values can be set by external variables of the EA and the names of these variables can be written into iCustom() instead of the hardcoded values.
Note that when output to Journal using Print(), a normalized number may contain a larger number of decimal places than you expect. For example,
double a=76.671; // нормализованное число с 3 знаками после запятойPrint("Print(76.671)=",a); // выведем его как естьPrint("DoubleToString(a,8)=",DoubleToString(a,8)); // выведем с заданной точностью
pusheax: Thank you, it's just that when I try to open a position with 0.07 lot it gives an error (I thought that's the problem), it must be something else, I'll look into it further.
The first thing to do is to look at the description of the error number. This will shorten the search path.
All these parameters should be listed after comma in iCustom() after the indicator name, and after them two more parameters: buffer number and bar number, from which the data is taken. I.e:
All listed values can be set by external EA variables and write names of these variables to iCustom() instead of hardcoded values.
Thank you for your reply. But the fact is that I did so at first, but when I received wrong values, I decided to remove the parameters from iCustom, for the Expert Advisor to use the standard parameters of the indicator. In both cases, however, EA gets wrong values. For example, Alert gives 30.32362 for the Blue line, but when I look at the indicator chart it has 22.3320 in the same place. And the same with other lines.
E_Ghazaryan: Thanks for the reply. But the thing is, I did so at first, but when I got wrong values, I decided to remove the parameters from iCustom so the EA would use the standard indicator parameters. However, in both cases, the Expert Advisor receives wrong values. For example, Alert gives 30.32362 for the Blue line, but when I look at the indicator chart it has 22.3320 in the same place. And the same with the other lines.
Show me the code where you take the data from the indicator.
Artyom Trishkin: Show me the code where you take data from the indicator.
The code was big. But to find out what the problem is, the Expert Advisor does not work by the rules, I cut this part into a separate one and started to test it.
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.
Yeah, right =D )))) Already attached.)))
All these parameters should be listed after comma in iCustom() after the indicator name, and after them two more parameters: buffer number and bar number, from which the data is taken. I.e:
iCustom(Symbol(), Period(), "_MTF_ADX3", 0, 500, 6, 6, 8, 14, 6, 6, 2, true, false, buffer_number, bar_number).
All the listed values can be set by external variables of the EA and the names of these variables can be written into iCustom() instead of the hardcoded values.
Can you tell me why:
double d = 0.07;
d = NormalizeDouble(d,2);
in both cases d== 0.07000000000000001
how do I leave 2 decimal places?
Can you tell me why:
double d = 0.07;
d = NormalizeDouble(d,2);
in both cases d== 0.07000000000000001
how to leave 2 decimal places?
Note that when output to Journal using Print(), a normalized number may contain a larger number of decimal places than you expect. For example,
will be output in the terminal:
That is, for printing the output of extra values is not a problem.
Note that the normalised number when output to the logbook using Print() may contain more decimal places than you expect. For example,
will be output in the terminal:
So, for printing, outputting extra values is not a problem.
Thank you, it's just that when I try to open a position with 0.07 lot it gives an error (I thought that's the problem), it must be something else, I'll look into it further.
good evening
I have declared a dynamic array
double all_order[][10];
I redefined in OnInit
ArrayResize(all_order, 20);
I enter data into the function
void OR_spisok(double a0, double a1, double a2, double a3, double a4, double a5)
{
int a10=int(a0);
all_order[a10][0]=a0;
all_order[a10][1]=a1;
all_order[a10][2]=a2;
all_order[a10][3]=a3;
all_order[a10][4]=a4;
all_order[a10][5]=a5;
}
three lines works fine, on 4 it clinches
2015.10.09 20:13:47.908 3102 EURUSD,H1: array out of range in '3102.mq4' (393,10)
393,10 it is:
all_order[a10][0]=a0;
what is wrong?
Removed line#property strict
The script works, can I continue without this line?
good evening
declared a dynamic array
Removed the#property strict line
The script works, can I continue without this line?
All these parameters should be listed after comma in iCustom() after the indicator name, and after them two more parameters: buffer number and bar number, from which the data is taken. I.e:
iCustom(Symbol(), Period(), "_MTF_ADX3", 0, 500, 6, 6, 8, 14, 6, 6, 2, true, false, buffer_number, bar_number).
All listed values can be set by external EA variables and write names of these variables to iCustom() instead of hardcoded values.
Thanks for the reply. But the thing is, I did so at first, but when I got wrong values, I decided to remove the parameters from iCustom so the EA would use the standard indicator parameters. However, in both cases, the Expert Advisor receives wrong values. For example, Alert gives 30.32362 for the Blue line, but when I look at the indicator chart it has 22.3320 in the same place. And the same with the other lines.
Show me the code where you take data from the indicator.
The code was big. But to find out what the problem is, the Expert Advisor does not work by the rules, I cut this part into a separate one and started to test it.
double Ind_Blue=iCustom(NULL, 0, "_MTF_ADX3",1,0);
double Ind_Red=iCustom(NULL, 0, "_MTF_ADX3",2,0);
Alert(" Ind_Blue= " , Ind_Blue , " Ind_Red= " , Ind_Red);
I am also attaching the Expert Advisor file. I don't want to waste your time, but I can't find the problem.
And there is a similar indicator with the same problem (Adx mtf). I have an mq4 file for it. But there seems to be no problem in the code.