Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1340
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
It works fine. And the list of 22 instruments. It takes about 5 minutes. It's weird, though. It spends most of its time writing handles to the array. Profiling results
Question: Why is it so time-consuming to copy 5 values from a handle to an array, although it is copied 132 times for 22 instruments from the list, i.e. for 273 instruments I would need to copy 1632 times, and with loading history for all the instruments on the hard disk.
about creating and deleting handles,
it works, I'm interested in the right way, I hope the developers will tell me.
That's just what I'm doing, look at the code above, there are questions too))
So, it turned out that the script
works fine. And the list of 22 tools takes about 5 minutes to process. This is weird, though. It spends most of its time writing the handle to the array. Profiling result
Question: Why is it so time-consuming to copy 5 values from a handle to an array while copying is performed 132 times for 22 tools from the list, i.e. for 273 tools I would need to copy 1632 times with history loading for all the tools to my hard disk.
If I'm not mistaken.
It seems to work normally, if the quotes have been downloaded, it does not slow down. The first start is very long, apparently it downloads the quotes.
The point of the script is to go through each instrument from Market Watch on timeframes from 1min to 4H
If I were to do such a thing, I would create an array and store past data in it, updating current data. This would avoid heavy cycles and CopyBuffer. Everything would fly.
If I'm not mistaken.
It seems to work fine, if the quotes are downloaded, it does not slow down. The first start takes a very long time, I guess it downloads the quotes.
Thank you for your feedback and your version of the program, I will try it)! I only wonder why I don't delete handles before finishing the program or they will be deleted automatically after the program is finished, but the memory is not freed according to the task manager.
If I were to do such a thing, I would create an array and store past data in it, updating current data. This would avoid heavy loops and CopyBuffer. Everything would fly.
Thanks! I'll think about it too)
Thank you for your feedback and your version, I will experiment with it)! I don't understand only why you don't delete handles before terminating the program? Or they are automatically deleted at the end of the program, although the RAM is not freed, judging by the task manager.
I read somewhere that indicators handles are automatically deleted after some time interval after the script terminates. But it's not exact.
Hello
the terminal has a linear regression tool
There are scripts that draw the same channel with graphical objects
But only the central line is drawn correctly, deviation lines are drawn at an incorrect distance from the central one
advise if you know the correct formula for calculating the deviation, it should be like in the terminal
or maybe there is a ready-made solution
THANK YOU
Hello!
Can you please tell me why OrderSend function on cryptocurrency does not work when testing with AMarkets broker. I couldn't find any prohibition on trading advisors on crypto by the regulations. Or maybe I have errors in my code? GetLastError gives error 4756