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
if(CopyBuffer(handle_MA,0,0,ma_values_to_copy,buffer_MA) < 0 ) // копируем данные из индикаторного массива в массив buffer_MA
{ // если не скопировалосьPrint("Не удалось скопировать данные из индикаторного буфера в buffer_MA, код ошибки "+ IntegerToString(GetLastError())); // то выводим сообщение об ошибкеreturn(0); // и выходим из функции
}
After that we can say more confidently what is wrong
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:
if(iTime(NULL,PERIOD_M15,1)==0)
return0;
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
Bars(NULL,PERIOD_M15);
..., 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
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?
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.
The "Max bars on chart" parameter is set inthe platformsettings. This parameter allows controlling the amount of historical data shown on the chart.
The charts are plotted against Bid prices. If theDepth of Market is available for the symbol, the charts will be plotted at Last prices (the price of the last trade executed).
Графики в торговой платформе отображают изменение котировок финансовых инструментов во времени. Они необходимы для проведения технического анализа и работы советников. Они позволяют трейдерам наглядно следить за котировками валют и акций в режиме реального времени и моментально реагировать на любое изменение ситуации на финансовых рынках...
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.
The "Max bars on chart" parameter is set inthe platformsettings. This parameter allows controlling the amount of historical data shown on the chart.
The charts are plotted against Bid prices. If theDepth of Market is available for the symbol, the charts will be plotted at Last prices (last trade price).
Good day Vladimir, as always you help me out :) Thank you!
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
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?