long currChart=ChartFirst();
int i=0;
while(currChart>=0)
{
Print(i,ChartSymbol(currChart)," ID =",currChart);
currChart=ChartNext(currChart); // на основании предыдущего получим новый график
i++;// не забудем увеличить счетчик
}
Thanks, that's what I read (that's where I started).
Everything works in my code, just a glitch in MT4, charts 8 but sees 7(
Very bad reading. Probably like forced reading at school. I've read it but nothing has been imprinted on my brain.
Here 's an example. The purpose is different there, but still the enumeration of open charts doesn't change depending on the purpose of the enumeration.
Or here is the code
/********************Script program start function*******************/voidOnStart()
{
long prevChart = 0;
int i = 0;
do
{
prevChart = ChartNext(prevChart);
ChartSetInteger(prevChart, CHART_BRING_TO_TOP, 0, true);
Sleep(200);
i++;
}
while(prevChart >= 0);
}/*******************************************************************/
How many charts are open, which ones? Symbol, period.
Unfolded/unfolded?
Alexey Viktorov:
Very bad reading. Must have been like forced reading at school. I mean, I read it, but nothing stuck in my head.
Here 's an example. The goal is different there, but still the enumeration of open charts does not change depending on the purpose of this enumeration.
Or here is the code
The issue is removed, the problem is solved by restarting the terminal
double GetExtremumZigZagPriceHigh(string symbol="",ENUM_TIMEFRAMES timeframe=0,int extremum_number=0)//,int depth=12,int deviation=5,int backstep=3)
{
if(symbol=="") //Если symbol = "" , то..
symbol=Symbol(); //Присвоить переменной symbol значение текущего символа на графике.//Объявить необходимые переменные:double price[]; //Цена экстремума выбранная из массива таймсерии.//datetime time[];int count; //Счетчик цикла.int bars_quantity=1000; //Количество баров на графике.int extremum_count=0; //Счетчик экстремумов.ArraySetAsSeries(price,true); //Устанавить флаг, чтобы индексация массива производилась как в таймсериях.CopyBuffer(handle,1,0,bars_quantity,price); //Скопировать в динамический массив price[] цены указанного количества баров.for(count=1; count<bars_quantity; count++) //Запустить цикл, который будет бежать по каждому бару.
{
if(price[count]!=0) //Если Цена Зигзага есть, то есть не равна нулю, то..
{
extremum_count++; //Увеличить счетчик экстремумов на одну единицу.if(extremum_count>extremum_number) //Если счетчик экстремумов превысил значение указанного номера экстремума, то..return(price[count]); //Вернуть эту цену.
}
}
//Print("GetExtremumZigZagPrice(): Экстремум ЗигЗага ",extremum_number," не найден"); //А до тех пор, пока ЗигЗаг не показывает цену,return(0); //Печатать Print, и возвращать ноль.
}
Number of copied array elements or -1 in case of error .
Note
When requesting data from an indicator, if the requested timeseries have not been built yet or need to be downloaded from the server, the function will immediately return -1, but the loading/building process itself will be initiated.
When requesting data from the Expert Advisor or a script, the loading from the server will be initiated if the terminal does not have these data locally, or the building of the required timeseries will begin if the data can be built from the local history, but they are not ready yet. The function will return the amount of data that will be ready when the timeout expires.
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.
Read the documentation and example code carefully. Your loop is not organised correctly.
Don't tell me that for and while loops work the same way. That's not the problem, it's the highlighted lines.Thanks, I've read it (that's where I started)
Everything works in my code, just a glitch in MT4, charts 8 but sees 7(
Unlikely. How many times have I blamed the platform, it always turns out to be wrong myself.
Why don't you try this?
Why don't you try this?
Same thing.
Why is the printing different? Different code?
How many charts are open, which ones? Symbol, period.
Unfolded/unfolded?Thanks, that's what I read (that's where I started).
Everything works in my code, just a glitch in MT4, charts 8 but sees 7(
Very bad reading. Probably like forced reading at school. I've read it but nothing has been imprinted on my brain.
Here 's an example. The purpose is different there, but still the enumeration of open charts doesn't change depending on the purpose of the enumeration.
Or here is the code
Why is the printing different? Different code?
How many charts are open, which ones? Symbol, period.
Unfolded/unfolded?Very bad reading. Must have been like forced reading at school. I mean, I read it, but nothing stuck in my head.
Here 's an example. The goal is different there, but still the enumeration of open charts does not change depending on the purpose of this enumeration.
Or here is the code
The issue is removed, the problem is solved by restarting the terminal
Help me avoid array out of range in this code
It's this location that's getting thrown out.
CopyBufferВозвращаемое значение
Number of copied array elements or -1 in case of error .
Note
When requesting data from an indicator, if the requested timeseries have not been built yet or need to be downloaded from the server, the function will immediately return -1, but the loading/building process itself will be initiated.
When requesting data from the Expert Advisor or a script, the loading from the server will be initiated if the terminal does not have these data locally, or the building of the required timeseries will begin if the data can be built from the local history, but they are not ready yet. The function will return the amount of data that will be ready when the timeout expires.
Check if you have bars_quantity there