Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1283

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
How do I determine how much load an EA puts on the server?
At every tick it asks Ask, Bid, Spread, TICKVALUE
If I understand correctly, the profiler will help. But we should understand that the load is not the same as the load. It is time spent on request execution and CPU load. If there is one Expert Advisor per symbol on one window, it's OK. But if there are 120 windows at 40 symbols and so in 10 terminals in one machine, the machine might freeze.)
I don't know, you could try it in battle. Or perhaps as an optionINT_MAX?
Yes, that's how I calculate:
And from date to date including weekends is something else.
Points per second, yes it's readable. And on lower TFs the speeds are higher and the range is smaller.
If I understand correctly, a profiler will help. But you have to understand that load is not the same as load. This is time spent on query execution or CPU load on the machine. If there is one Expert Advisor per symbol on one window, it's OK. And if there are 120 windows at 40 symbols and so in 10 terminals in one machine, the machine might freeze.)
We have already discussed if the terminal data from MQL4 should be accessed many times, then OrderSelecthttps://www.mql5.com/ru/forum/342989#comment_16743716
the same way you can test getting the current price - I think you can use it 100500 times per tick as well, since the output will be increased millions of times per second
the more symbols in the market watch window, the bigger will be load on the terminal itself, and respectively, if you call data from a lot of different symbols, then you will also get lags
i.e. if you use the terminal sensibly, nothing will freeze - in the market watch window there are ten symbols you use
i haven't checked how many charts you can open at the same time, but i think that if you limit the history to 1000 bars, then i think the terminal will probably open a couple dozen chart windows without any problems
Good day to all!
I have started to study mql5 (after mql4). There is a function group in mql4 called date and time. There is the same group in five. But this group of functions in five is much less than in four. There are no functions in five that return values of the current hour, minute ... and other functions.
For example, in fourth there was the Hour() function, which returned the value of the current hour. Five has no such function.
QUESTION
Which functions in five are analogous to Hour() and other functions from the four's Date and Time function group that are not in the similar group in five.
Thank you for your help.
We have already discussed whether it is necessary to repeatedly access terminal data from MQL4, then OrderSelecthttps://www.mql5.com/ru/forum/342989#comment_16743716
i think it is possible to use it 100500 times per tick as well, because the output will be increased millions of times per second
the more symbols in the market watch window, the bigger will be load on the terminal itself, and respectively, if you call data from a lot of different symbols, then you will also get lags
i.e. if you use the terminal sensibly, nothing will freeze - in the market watch window there are ten symbols you use
i haven't checked how many charts you can open at the same time, but i think that if you limit the history to 1000 bars, then the terminal will probably open a couple dozen chart windows without any problems
(Thank you for the reminder))) I mean that with reasonable requests everything should work, i.e. low-cost (in terms of time of execution and CPU load) requests).
Good day to all!
I have started to study mql5 (after mql4). There is a function group in mql4 called date and time. There is the same group in five. But this group of functions in five is much less than in four. There are no functions in five that return values of the current hour, minute ... and other functions.
For example, in fourth there was the Hour() function, which returned the value of the current hour. Five has no such function.
QUESTION
Which functions in five are analogous to Hour() and other functions from the date and time function group in four that are not in the similar group in five.
Thank you for your help.
use https://www.mql5.com/ru/docs/dateandtime/timecurrent
second version of the function call
in general, it ishttps://www.mql5.com/ru/docs/dateandtime/timetostructThanks, that reminds me))) Yes, a lot of things I didn't understand at the time) I just wanted to say that with reasonable requests everything should work. These are cheap in cost (execution time and CPU load) requests).
yes
If the code is "dirty", you can screw up any system
and if it is a reasonable use, where reference to the Ask/Bid price occurs even a few tens of times per tick, then it will not affect the EA performance (maximum 1-2%)
i.e. the logic of using resources (or calls of system functions / environment of the terminal) should be, if the algorithm implies accessing Ask/Bid prices several thousand times per tick, then.... most likely you should reconsider the algorithm itself, or alternatively, remember the values ofAsk/Bid once before calculating the algorithm
Please advise for 4k. Coordinates of mouse click on a chart how to return, preferably by a bar number. Find only the coordinates where they threw the script.
probably look forChartXYToTimePrice https://docs.mql4.com/ru/chart_operations/chartxytotimeprice
only discussedhttps://www.mql5.com/ru/forum/353726
here's another thread also discussing clickshttps://www.mql5.com/ru/forum/344607
if the algorithm implies referring to Ask/Bid prices several thousand times per tick, then.... most likely you should reconsider the algorithm itself, or alternatively, remember Ask/Bid values once before calculating the algorithm
perhaps look forChartXYToTimePrice https://docs.mql4.com/ru/chart_operations/chartxytotimeprice
just discussedhttps://www.mql5.com/ru/forum/353726
here's another thread also discussing clickshttps://www.mql5.com/ru/forum/344607
In general, if we got prices on the tick, we can work with them until the end of OnTick, if it's not critical. And limiters to help prevent slippage).
I wanted to click on a candlestick and write its value into a file.
CHARTEVENT_MOUSE_MOVE
Generally, if we got prices on the tick, we can work with them until the end of the OnTick, if not critical. And limiters to help against slippage)
I want to click on a candle and save its value in a file.
CHARTEVENT_MOUSE_MOVE
Maybe that's how you want to determine the bar price and time:
or rather these are mouse click coordinates in the values time + price on the chart, the bar should be defined viaiBarShift()