Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1339

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
Hi!!! Tell me where I went wrong, I don't understand it myself)
Out of 275 tools, it processes 27 and then gets stuck, occupies memory, and produces an error string when the script is forced to terminate.
If this array
then using it in
it's not right at all.
Or have I misunderstood something?
If this array
then its use in
is not right at all.
Or did I misunderstand something?
There's a lot of things wrong with it.
If this array
then using it in
is not right at all.
Or did I misunderstand something?
Why wrong? Because in the example to the function
CopyBuffer
and use
Alexey Viktorov #:
Or did I misunderstand something?
The point of the script is to go through each instrument in the Market Watch on timeframes from 1min to 4H to find the price above the MA200 and if this fact is detected, to generate an alert with the name of the symbol with the price above the MA on all 6 timeframes.
There are a lot of things wrong with it.
Be more specific, if you don't mind)
Be more specific, if you don't mind)
Array indexing is just plain creepy... Copying the same data in a loop... Creating new handles in a loop - no words...
I don't even want to look at the rest of them, sorry
Array indexing is just plain creepy... Copying the same data in a loop... Creating new handles in a loop - no words...
I don't even want to look at the rest of the code, sorry
I don't understand about indexing of arrays, what arrays you don't like? The data on line 43 of CopyBuffer function copies handles on different timeframes, from 1 minute to 4H. 5 MA indicator prices are copied, for the first 5 bars, and both handle and array with 5 bars are zeroed at each iteration
ArrayFree(bufer_MA);
and the handle is deleted.
If you can propose an algorithm for handling 274 symbols and each of them on 6 timeframes in some other way, I would be happy to. It's just that the thread is kind of called -- Questions from Beginners. If I were a pro, I probably wouldn't have any questions.
creation of handles in different situations seems not costly, it's just a pointer without preloading? the main work is done with CopyBuffer
there is no need to remove the handle in the loop, you may need to check it. Personally, I have a constant problem only when creating the first one; it is solved by Sleep() to load a chart or the function of pre-loading quotes
the developers should have decided it themselves, speed is not important in OnInit, I meant the first indicator with 7 symbols, the error is always showing up at different iterations
----------
how does creating a handle work, in a special loop is it necessary to check availability or is just another creation enough (i.e. overwriting)?
creation of handles in different situations seems not costly, it's just a pointer without preloading? the main work is done with CopyBuffer
there is no need to remove the handle in the loop, you may need to check it. Personally, I have a constant problem only when creating the first one; it is solved by Sleep() to load a chart or the function of pre-loading quotes
the developers should have decided it themselves, speed is not important in OnInit, I meant the first indicator with 7 symbols, the error is always showing up at different iterations
----------
how does creating a handle work, in a special loop is it necessary to check availability or just another creation is enough (i.e. overwriting)?
Are you talking to me or is it a question for local experts?)
Are you talking to me, or is that a question for the experts here?)
About creating and removing handles,
It works, I'm interested in the right way, I hope the developers will tell me.