Questions from Beginners MQL5 MT5 MetaTrader 5 - page 456
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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.