Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1019
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
The first pathway helped )))) Thanks.
One more question: I tear off 3 indicator instances in the indicator to get data from different TFs. But when I attach it to a chart, I get this kind of spreadsheet:
What would it mean?
I can't say for sure, but maybe the 2nd buffer was initialized late.
To find out exactly what is the reason, you should adjust the following lines like this
After that we can say more confidently what is wrong
I can't say for sure, but maybe the 2nd buffer was initialized late.
In order to find out exactly what is the reason, you should adjust the following lines like this
After that we can say with more confidence what's wrong.
Can something be done with it?
By the way, this copy opens on M15.
However, the same thing is at other TFs too...
Is there anything you can do about it?
By the way, this copy opens on M15.
It's the same on other timeframes as well...
In the timer, once every two minutes, ask for any data for the required timeframe. This way you will always have up-to-date data for the timeframe.
In addition: in OnCalculate() at the very beginning of it, you request it, for example:
Thus, until the data of the fifteen-minute timeframe is available, the indicator will wait for the next tick.
You can request the right amount of data for the calculation by using the CopyXXX function:
In this case, until the required number_of_datas data is available, the indicator will wait for the next tick.
If you decide to use the function
..., you should take into account, that the amount of data for the calculation should not exceed the rates_total, otherwise it will exceed the limits of the array. In other words, if there are less bars on the current timeframe than on M15, then we should take the number of bars equal to their number on the current timeframe = rates_total
In the timer, once every two minutes, request any data for the required timeframe. This way you will always have up-to-date data for the timeframe.
In addition: in OnCalculate() at the very beginning of it you request, for example:
So, until the 15 min timeframe data is available the indicator will wait for the next tick.
You can request the right amount of data for the calculation with the CopyXXX function:
In this case, until the required amount of data in number_of_datas is available, the indicator will wait for the next tick.
If you decide to use the function
..., you should take into account, that the amount of data for the calculation should not exceed the rates_total, otherwise it will exceed the limits of the array. In other words, if there are less bars on the current timeframe than on M15, then we should take the number of bars equal to their number on the current timeframe = rates_total
Thanks.
Did it like this:
result:
I'm having a hard time with indicators ))))
Hi all!
Please advise on function CopyHigh.
I've read in the definition of this function, "Gets history data to an array with maximal bar price for a specified symbol and period".
Are we talking about a Bid or Ask price array ? Or is there some way to set the type of price needed?
Hi there!
Please advise on the function CopyHigh.
I've read in the definition of this function, "Gets history data to an array of maximum bar prices for a specified symbol and period".
Are we talking about a Bid or Ask price array ? Or is it possible to set the type of price needed somehow?
Reference:Features of Plotting
Features of making charts
The history data, on the basis of which the charts are built, is stored on the hard disk. When you open a chart, the data is downloaded from the disk and the last missing data from the trading server is downloaded. If the historical data on a financial instrument is not available on the hard disk, the last 512 bars of the history are downloaded.
To download the earlier data, move the chart to the required area. Once the chart is opened, the platform will start receiving information about the current quotes. Thus, the further price movement is formed in real time. This information is automatically saved in a history file and is used when opening this chart again in the future.
Reference:Features of graphing
Features of making charts
Historical data, on the basis of which charts are built, is stored on hard disk. When you open a chart, the data is downloaded from the disk and the last missing data from the trading server is downloaded. If the historical data on a financial instrument is not available on the hard disk, the last 512 bars of history are downloaded.
To download the earlier data, move the chart to the required area. Once the chart is opened, the platform will start receiving information about the current quotes. Thus, the further price movement is formed in real time. This information is automatically saved in a history file and is used when opening this chart again in the future.
Good day Vladimir, as always you help me out :) Thank you!
How to find the smallest candle of N in mql5?
In mql4
How to find the minimum candle of N in mql5?
In mql4
In Expert Advisor or in an indicator? For the current timeframe or for another one?