Good day everyone! I am testing the algorithm in MT-4 tester using mql4. I need Print() function to output the Bid price in log with 5 (five) decimal places. But it would only print 4 (four) decimal places. I used NormalizeDouble(Bid,Digits) function to add the fifth digit.
Please tell me how to fix my mistake if it exists. Here is my code.
At the same time, if I print () the opening and closing price of an order ( by SL and TP), Print() prints the price with 5 (five) digits, even without the help of NormalizeDouble() and without the help of any other functions. Thank you all for your help.
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 anyone suggest a scheme for how to get from an array like this
get the digits of which there are 3 or more in a row in the array, i.e. the values "5" and "9" fit
need to get the type of
value1=9;
value2=5;
or array value[]={9,5};
I have been puzzling with while do for two days now and can't figure out the scheme
can anyone suggest a scheme for how to get from an array like this
get the digits of which there are 3 or more in a row in the array, i.e. the values "5" and "9" fit
need to get the type of
value1=9;
value2=5;
or array value[]={9,5};
day two I can't figure out the while do scheme
sketched it out, but it solved it head-on, it works in general, but didn't like my solution:
2020.09.10 11:51:26.323 tst (EURUSD,M5) 5 9
sketched out, but decided head-on, works in general, but didn't like my solution:
2020.09.10 11:51:26.323 tst (EURUSD,M5) 5 9
Thanks, too much action
I would like to find a solution in the loop. I will try to use continue; and break; operators
it has to be taken from the indicator buffer at every new bar prev_calculate-100 approximately
Thanks, too much action
I would like to find a solution in the loop. I will try to use continue; and break; operators
it must be taken from the indicator buffer on each new bar prev_calculate-100 or so
it is not cumbersome, I did not like it as I did not look for other variants - I always do it that way
add the loop from the second function.... to the body of the first function there will be less bodily effort
whether withor without break - this problem will be solved in 2 loops anyway.... but it is not exact! - decide ;)
not cumbersome, didn't like it because I didn't look for other options - I always do it this way
introduce the loop from the second function.... into the body of the first function there will be less bodily effort
whether withor without break - this problem will be solved in 2 loops anyway.... but it is not exact! - decide ;)
I'll try to mess around, I'll write if I get it
I'll give it a go and let you know if it works
not cumbersome, didn't like it because I didn't look for other options - I always do it this way
introduce the loop from the second function.... into the body of the first function there will be less bodily effort
whether withor without break - this problem will be solved in 2 loops anyway.... but it is not exact! - decide ;)
error, if there will be four "9's" in the queue, instead of 3, the result will be
5 9 9 2
error, if there are four "9's" in the queue rather than 3, the result is
5 9 9 2
i told you i didn't like my solution (((
Too lazy to write again.
Google "array find repetitions" - I think you'll find something
can anyone suggest a scheme for how to get from an array like this
get the digits of which there are 3 or more in a row in the array, i.e. the values "5" and "9" fit
need to get the type of
value1=9;
value2=5;
or array value[]={9,5};
i can't figure out the scheme for the second day
int qty[10]; // счётчики по цифрам
int total; // всего элементов в исходном массиве arr[]
int code=arr[0]; // текущая цифра
int count=1; // кол-во повторов
for(int i=1;i<total;i++) {
if (arr[i]!=code) { if (count>qty[code]) qty[code]=count; code=arr[i]; count=1;}
else count++;
}
if (count>qty[code]) qty[code]=count;
/// в массиве qty - требуемое
add additional checks about permissibility of elements arr[] (that they are digits) to taste
Good day everyone!
I am testing the algorithm in MT-4 tester using mql4. I need Print() function to output the Bid price in log with 5 (five) decimal places. But it would only print 4 (four) decimal places. I used NormalizeDouble(Bid,Digits) function to add the fifth digit.
Please tell me how to fix my mistake if it exists.
Here is my code.
}
At the same time, if I print () the opening and closing price of an order ( by SL and TP), Print() prints the price with 5 (five) digits, even without the help of NormalizeDouble() and without the help of any other functions.
Thank you all for your help.