Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1167
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 internet and good health to all.
Question, what am I doing wrong? The arrays (STATIC) are filled in, but the calculation gives 0 (zero). Can you tell me what I don't have in my code? Why the array elements are not being compared and added...? Thanks
double Open[60],High[60],Lo[60,Close[60]; int to_copy=60;
Comment(High[10],". ",candle);
candle дает результат 0 ноль
Good internet and good health to all.
Question, what am I doing wrong? The arrays (STATIC) are filled in, but the calculation gives 0 (zero). Can you tell me what I don't have in my code? Why the array elements are not being compared and added...? Thanks
1) The loop goes beyond the array - if the buffer size is 60, the last index is 59, because the first index is 0
2) The code is not complete - e.g. how is Tf defined and what was candle initialised with?
* when copying prices the indexing is shifted by one, because you copy 60 elements starting from the first index, i.e. prices of the first closed bar will already be under index 0
How the function works
IsStopped();
... and what list of tasks does it perform?
In help it is written - "Checks forced termination of mql5-program". That is, it sort of "looks" at some number of lines of code ahead and checks if anything is correct? How is its area of responsibility set (e.g. per line or 10 lines)?
I thought it only prevents the loop from going beyond the array, but I saw it back in the FAMA code before copying High and Low prices
How the function works
... and what list of tasks does it perform?
In help it is written - "Checks forced termination of mql5-program". That is, it sort of "looks" at some number of lines of code ahead and checks if anything is correct? How is its area of responsibility set (e.g. per line or 10 lines)?
I thought it only prevents the loop from going beyond the array, but I saw it still in the FAMA code before copying prices High and Low
It doesn't look anywhere... It's clearly written there. It checks the flag... Reread it.
How the function works
... and what list of tasks does it perform?
In help it is written - "Checks forced termination of mql5-program". That is, it sort of "looks" at some number of lines of code ahead and checks if anything is correct? How is its area of responsibility set (e.g. per line or 10 lines)?
I thought it only prevents the loop from going beyond the array, but I saw it in the FAMA code before copying the High and Low prices
if a stop of an MQL-program takes place, the _StopFlag will be set, and it can be checked either using a predefined variable or the IsStopped() function - whatever is convenient, use it that way.
after setting _StopFlag , MQL-program has a little time to stop, and then the terminal forcibly unloads it
the most widespread use - looped scripts, you should not
it is better to write it this way:
well, sometimes in cost calculations or in large cycles they use
Hi all.
Can you tell me if it's possible to loop through variables with names: L1, L2, L3 ... Ln to write to a two-dimensional array
1) The loop has an array overrun - if the buffer size is 60, then the last index will be 59, as the first index is 0
2) The code is not complete - e.g. how is Tf defined and what was candle initialised with?
* when copying prices the indexing is shifted by one, as you copy 60 elements starting from the first index, i.e. the prices of the first closed bar will already be under index 0
THANK YOU for your reply. Full code. Increased the static size of the array. Removed zero control entry in operators. Common "dummy". I'm still trying to figure out WHY it's not adding. What's not in my code now? Thanks for the tips. I haven't worked with static arrays in mql5 yet.....
I UPDATED THE CODE. The question is the same...
Hi all.
Can you tell me if it's possible to loop through variables with names: L1, L2, L3 ... Ln to write into a two-dimensional array
deleted the post - you know about arrays
but still not possible
as an option to write a macro substitution, write a specific example - maybe someone will write a macro to your task, I'm bad at writing macros.
People!!! (Hint ... )))
Full code. Increased static array size. Removed write zero control in operators... Common "dummy". Still want to understand WHY it doesn't count addition. What is missing in my code now? Thanks for the tips. I haven't worked withstatic arrays in mql5 yet.....
I UPDATED THE CODE. The question is the same...
THANK YOU for the reply. Full code. Increased static array size. Removed zero control entry in operators... Common "dummy". I'm still trying to figure out WHY it's not adding. What is missing in my code now? Thanks for the tips. I haven't worked with static arrays in mql5 yet.....
I UPDATED THE CODE. The question is the same...
I am not familiar with indicators, but it's just unnecessary. I already have it ))))