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
Insert the code correctly.
It worked fine there, that "piece of code which is responsible for insufficient data". And correctly reported that when the first tick arrives, the 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 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 doesn't increase the amount of calculated indicator data :)
You are also concerned about two errors: "insufficient calculated data" and "array out of range". But for some reason you didn't write anything about the second error (you didn't give a code example with line 92), although you emphasized it several times.
I see. On the line
there is an exit outside the array. And the output is in RSI1_Buffer[i]. ...It's hard to answer yet, there should be no output outside the array.for (int i=3; i<Bars; i++)
{
Up=iFractals(NULL, 0, MODE_UPPER, i); if (Up>0) break;
}
Hi all ...who can tell me how the following code would look like in mql5 :
for (int i=3; i<Bars; i++)
{
Up=iFractals(NULL, 0, MODE_UPPER, i); if (Up>0) break;
}
This article is to help.
Change double iFractals(string symbol, int timeframe, int mode, int shift) in fours to
Question about strategy tester: I need to select a set of parameters with max percentage of profitable trades - how can I do that? I think "Balance + min DD" is more or less suitable as an optimization criterion, but profit as a multiplier nullifies everything else...
What does this have to do with the balance and the percentage of profit trades?
I think there was an article, google "How to create your own criteria for optimizing a trading robot site:mql5.com".
What does this have to do with the balance and the percentage of profit trades?
I think there was an article, google "How to make your own optimization criteria for a trading robot site:mql5.com".
Found it, thanks.
https://www.mql5.com/ru/articles/286