Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1451
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
Good afternoon, please help me to understand...
MathMax returns the maximum of two numeric values, i.e. it returns the maximum numeric value from two identical arrays high[rates_total] with a difference of -1 and -2 bars?
In simple words: In the first array 12345 and in the second 1234, will this function return 5?
No. The function will return 12345.
Good afternoon, please help me to understand...
MathMax returns the maximum of two numeric values, i.e. it returns the maximum numeric value from two identical arrays high[rates_total] with a difference of -1 and -2 bars?
In simple words: the first array has 12345 and the second has 1234, will this function return 5?
It will return the maximum value of the two, which are high[rates_total-1] and high[rates_total-2].
If address high[rates_total-1] contains value 12345, and address high[rates_total-2] contains value 1234, which of these two values is greater?
12345 is clearly greater than 1234 by an order of magnitude. The value 12345 of high[rates_total-1] will be returned.
The maximum value of the two at high[rates_total-1] and high[rates_total-2] will be returned.
If address high[rates_total-1] contains value 12345, and address high[rates_total-2] contains value 1234, which of these two values is greater?
12345 is clearly greater than 1234 by an order of magnitude. The value 12345 of high[rates_total-1] will be returned.
Thanks... But there is a question about rationality of the string if high[rates_total-1] is already one bar greater than high[rates_total-2]
Or is there a different meaning here?
Thank you.
Thank you... but this raises a question about the rationality of the string if high[rates_total-1] is already one bar more than high[rates_total-2]
Or is there something else that makes sense here?
Thank you.
What do the bars have to do with it?
You are comparing high values on two bars of the same array. The rates_total-1 and rates_total-2 indicate which values of the two bars you are comparing.
You are comparing the High values of the bars located on rates_total-1 and rates_total-2, not the values of the indices.
What you are thinking of would look like this: MathMax(rates_total-1, rates_total-2) - this is where rates_total-1 will always be returned.
Can you tell me how to sum up all the values in the text? This code only creates
do you want to get the balance minus equity values?
What do the bars have to do with it?
You are comparing the values of High, which are on...
Good day to all!
In MT4, on the model ALL TIKES, on minute candlesticks, I test the Expert Advisor. My task is to make the program to spend as little time on code execution as possible. But what surprised me!!!!
In this code, the program checks every tick and spends 6 seconds for code execution. 375 milliseconds.
It seemed to me that the program should check not every tick, but only the first tick of each minute candle and spend much less time on code execution.
But the program spent 6 sec. 219 msec. From this I came to the conclusion that even though the code tells the program to check the expression in brackets only once per 60 seconds, it still checks this expression at every tick and spends almost as much time for execution as in the previous code.
Then I changed the model to VALUABLE VALUES and ran the second variant. But the program took the same6 seconds to execute it.219 milliseconds.
QUESTION . Is it possible to make the program in MT4 on the model ALL TICK, check not every tick, and only the first tick of a new minute candle, that would spend much less time for code execution. If it is possible, what function or language construct may be used?
Thank you.
Changed my code to match your code
Time taken by the program to execute the code.... 6 , 235, i.e. less than with my code (6.375), but not several times less
. It seems to me it should be several times less, because the program only has to check tick value once at the opening of each minute candle.
Which one of us is wrong..... it seems to me.