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
This error does not come out during compilation, but when I attach the indicator to the chart, or when I change the timeframe.
Does this error message play all the time, or does it disappear with time?
Guys! Can MT5 be connected to any brokerage company?
No. Trading through MT5 is possible through the broker that provides the possibility to trade through this platform, such as VTB24 and Alfa forex.
Does this error message play constantly, or does it disappear over time?
Does this error message play all the time, or does it disappear with time?
Does this error message play constantly, or does it disappear over time?
FinEngineer:
Once, when I attach the indicator to the chart...
Then you are doing fine. When you just attach the program to a chart or change timeframe, there is no new calculated data for RSI indicator or any other in the terminal. And the terminal needs some time to calculate the necessary indicator buffers. Look carefully at your code (I understand that it is written according to someone else's sample, but nevertheless): When the calculated data for RSI are not enough, the function OnCalculate() stops working ('return(0);') and waits for a new tick. As soon as on the next tick the indicator buffers for RSI are calculated, your indicator starts to work in normal mode. Which it does, judging by what you say.
You can also insert the check with BarsCalculated() into OnInit() function - then the error will occur very rarely (if at all). An example is given in the description of the BarsCalculated() function.
About this error I already wrote to you yesterday. (Don't forget to insert the code correctly :) )
Removed the piece of code responsible for insufficient data (below)
int calculated=BarsCalculated(RSI1_Handle);
if(calculated<rates_total)
{
Print("Not all data of RSI1_Handle is calculated (",calculated, "bars ). Error",GetLastError());
return(0);
}
calculated=BarsCalculated(RSI2_Handle);
if(calculated<rates_total)
{
Print("Not all data of RSI2_Handle is calculated (",calculated, "bars ). Error",GetLastError());
return(0);
Can you tell me how to mark code fragments in the message?
Now an error is coming out:
2012.12.22 15:14:00 Pair_delta_RSI (EURGBP,M1) Getting RSI1 is failed! Error4806Insert code correctly.
It worked fine there, that "piece of code which is responsible for insufficient data". And correctly reported that at first tick data for RSI is not yet calculated by the terminal. If you do not like to receive error messages, try to do as above, namely to check for calculated data not only in OnCalculate(), but also in OnInit(). In other words, try to wait for the data calculation for selected technical indicators in OnInit() and then move to the ticks processing in OnCalculate() when the data for indicators is guaranteed to be calculated.
Adding. In the end, the removal of a part of the check code does not increase the number of calculated indicator data :)