and you can't see what variable you are adding data to
Highest / Lowest is supposed to show.
Looked at this :
int val_index=iLowest(NULL,0,MODE_CLOSE,10,1);
Very close, but not yet.
Well, it shows the NUMBER of the last 10 (starting from the first "1") candlestick with the most low. But I need the price value, not the candle number.
it can all be done, the question was to those who measured the actual work, and better to the developers, who knows what they have in their plans there
Idon't want to experiment, there are many other tasks.
That's right. Not the king's business at .........
maybe we should close the Questions from beginners thread? Alexei, if you don't want to help, please stay out of it, there are too many complaints from you.
I was interested in a professional answer to have an idea how the platform works.
Help me to solve a simple problem. There is a code from MQL4. I want to adapt it to 5. That is, it should work similarly in MQL5.
My variant obviously does not work, for some reason there are a lot of errors):
CopyRates() instead of a bunch of indicators and code edits will become minimal, the code will remain compact and readable.
//Введем внешнюю переменную, чтобы иметь возможность изменить количество сканируемых свечей.externint Window=30;
voidOnStart()
{
//Вводим переменные.double Highest=DBL_MIN;// double Lowest=DBL_MAX; // MqlRates rates[];
//Сканируем 30 свечей и обновляем значения самых высоких и самых низких цен.if (CopyRates(_Symbol,_Period,30,rates)!=30) {
Alert("copyRates failed");
return;
}
for(int i=0; i<=Window; i++) {
if(rates[i].low<Lowest) Lowest=rates[i].low;
if(rates[i].high>Highest) Highest=rates[i].high;
}
//Выводим результат.Alert("Самая высокая цена ",Highest," - Самая низкая цена ",Lowest);
}
In reality, you should also add a check for curved quotes
Maxim, isn't CopyRates presented as getting all the features of the character?
cheaper there are individual features
there 1) according to developers' words virtual copying, i.e. if possible data are not transferred, internal references are transferred 2) even with full copying it is faster than CopyBuffer for iHigh,iLow separately (1 call instead of 2, which will still go into the same terminal structures).
and finally, the main thing: when porting, it is very important that the code should be as similar to the original as possible, even visually. You must be absolutely sure that it (the code) does exactly the same thing as the original. And small-optimisations are done afterwards, and only where it is really critical.
there 1) according to the developers virtual copying, i.e. if possible data are not transferred, internal references are transferred 2) even with full copying it is faster than CopyBuffer for iHigh,iLow separately (1 call instead of 2, which will still go to the same terminal structures).
and finally, the main thing: when porting, it is very important that the code should be as similar to the original as possible, even visually. You must be absolutely sure that it (the code) does exactly the same thing as the original. And small-optimisations are done afterwards, and only where it is really critical.
It's an eternal problem that developers don't want to answer.
that it is cheaper to get everything at once, or two necessary parts.
to my last question, in another thread they also didn't say anything, apparently they are busy with something else. or rather they don't know themselves. and there is no one to find out.
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.
Good evening, dear programmers!
Help me to solve a simple problem. There is a code from MQL4. I want to adapt it to 5. That is, it should work similarly in MQL5.
Look in the help
iHighand similar functions
If it doesn't work, there is an error in the loop.
and you can't see which variable you are adding data to
look in the help
and similar functions
if it doesn't work, there is an error in the loop
and you can't see what variable you are adding data to
Highest / Lowest is supposed to show.
Looked at this :
int val_index=iLowest(NULL,0,MODE_CLOSE,10,1);
Very close, but not yet.
Well, it shows the NUMBER of the last 10 (starting from the first "1") candlestick with the most low. But I need the price value, not the candle number.
In general, it is necessary not to look backwards, but forwards.
For example: search for the "minimum" from the beginning of the previous candle (which is numbered "1") during the next 100 candles.
it can all be done, the question was to those who measured the actual work, and better to the developers, who knows what they have in their plans there
Idon't want to experiment, there are many other tasks.
Right. Not a royal business in .........
That's right. Not the king's business at .........
maybe we should close the Questions from beginners thread? Alexei, if you don't want to help, please stay out of it, there are too many complaints from you.
I was interested in a professional answer to have an idea how the platform works.
Good evening, dear programmers!
Help me to solve a simple problem. There is a code from MQL4. I want to adapt it to 5. That is, it should work similarly in MQL5.
My variant obviously does not work, for some reason there are a lot of errors):
Apparently, you are completely unfamiliar with programming. That's why whatever advice you are given, you won't succeed so far .
But nevertheless... try to understand the function
and the function of working with arrays
There are other variants of solving this problem.
Good evening, dear programmers!
Help me to solve a simple problem. There is a code from MQL4. I want to adapt it to 5. That is, it should work similarly in MQL5.
My variant obviously does not work, for some reason there are a lot of errors):
CopyRates() instead of a bunch of indicators and code edits will become minimal, the code will remain compact and readable.
In reality, you should also add a check for curved quotes
CopyRates() instead of a bunch of indicators and code edits will become minimal, the code will remain compact and readable.
In reality, you should also add a check for curved quotes
Maxim, isn't CopyRates presented as getting all the features of a symbol?
cheaper there are individual functions
Maxim, isn't CopyRates presented as getting all the features of the character?
cheaper there are individual features
there 1) according to developers' words virtual copying, i.e. if possible data are not transferred, internal references are transferred 2) even with full copying it is faster than CopyBuffer for iHigh,iLow separately (1 call instead of 2, which will still go into the same terminal structures).
and finally, the main thing: when porting, it is very important that the code should be as similar to the original as possible, even visually. You must be absolutely sure that it (the code) does exactly the same thing as the original. And small-optimisations are done afterwards, and only where it is really critical.
there 1) according to the developers virtual copying, i.e. if possible data are not transferred, internal references are transferred 2) even with full copying it is faster than CopyBuffer for iHigh,iLow separately (1 call instead of 2, which will still go to the same terminal structures).
and finally, the main thing: when porting, it is very important that the code should be as similar to the original as possible, even visually. You must be absolutely sure that it (the code) does exactly the same thing as the original. And small-optimisations are done afterwards, and only where it is really critical.
It's an eternal problem that developers don't want to answer.
that it is cheaper to get everything at once, or two necessary parts.
to my last question, in another thread they also didn't say anything, apparently they are busy with something else. or rather they don't know themselves. and there is no one to find out.