Удобство имеет большое значение в работе, а тем более в работе трейдера, где скорость и точность решают многое. При подготовке терминала к работе каждый настраивает своё рабочее место максимально комфортно для себя, чтобы в максимально короткий срок можно было совершить анализ и войти в рынок. Но реальность такова, что разработчики не могут...
I have simply written how I set the pending orders in the visualizer.
I'm trying it now. I didn't want to waste time, I don't need the panel in the robot's operation, I just need it for a test. Therefore, I wasn't planning to study the subject in detail.
При тестировании в эксперте можно обрабатывать пользовательские события с помощью функции OnChartEvent(), но в индикаторах эта функция в тестере не вызывается.
Can you tell me why when I change code below from close[i-1] to close[i-2] the Array of Range occurs? The code was written strictly following MQL5 book, but it doesn't explain why the buffer is overrun when price is shifted by more than 2 cells.
{
int values_to_copy;
int start;
int calculated=BarsCalculated (iBands1_handle);
if (calculated <=0)
{
return (0);
}
if (prev_calculated==0 || calculated!=bars_calculated)
{
start=1;
if (calculated> rates_total) values_to_copy=rates_total;
else values_to_copy=calculated;
}
else
{
start=rates_total-1;
values_to_copy=1;
}
if(!FillArrayFrom_iBands1_handleBuffer(Base,Upper,Lower,iBands1_handle,values_to_copy)) return(0);
for (int i=start; i <rates_total &&!IsStopped ();i++)
{
Print("C ", close[i-2]);
}
Can you tell me why when I change code below from close[i-1] to close[i-2] the Array of Range occurs? The code was written strictly following MQL5 book, but it does not describe why withdrawal from buffer occurs when price is shifted by more than 2 cells.
As far as I understand, we are talking about an indicator. So, consider two cases of accessing an array-timeseries"close": (1) what happens when"start" equals "1" and (2) what happens when"start" equals "rates_total-1".
Just calculate in your mind the resulting"close" array index if you try to do "close[i-2]" for case (1) and for case (2).
I understand that we are talking about an indicator. So, consider two cases of accessing the"close" time-series array: (1) what happens when"start" equals "1" and (2) what happens when"start" equals "rates_total-1".
Just calculate in your mind the resulting"close" array index if you try to do "close[i-2]" for case (1) and for case (2).
Thanks, I checked, there was a need to put a number greater than 1 in the start = 1 value, debugging showed that the error occurs when the close array tries to take a value from a cell that has not yet appeared at the beginning of the recalculation.
I would like to create a two-dimensional array with opening and closing times and candlestick lengths, and it would be very interesting. I want to create an EA based on this example using higher mathematics, namely the triple integral. let's assume x and y know the price and time, find z - in this case I do.
Another question - if this code sets condition that closing price will be higher than the line (let's assume that this condition actually is before the program started), the code works as it should be but if we add a reverse condition, i.e. different current conditions before the code started, the data will not be correct after debugging. Please advise why it happens? After all, this is just a comparison in a condition statement, why should this have any detrimental effect on the code's performance at all?
for (int i = start; i < rates_total &&!IsStopped ();i++)
{
if(close[i] > Upper[i])
Print("C ", close[i]);
Example: if
if(close[i] < Upper[i])
The debugging result is as follows:
The data goes correctly, refreshing at the same rate as the price refreshes
But if we initially set such a condition:
if(close[i] > Upper[i])
Then the result will be incorrect:
That is, the values of closing prices don't coincide with the current price
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.
Unfortunately, I haven't come across the article, maybe someone else can suggest it.
You won't be able to set orders because you won't be able to enter the right setting price. The same applies to lots.
I set with the mouse.
I am betting with the mouse.
The control panel from this article https://www.mql5.com/ru/articles/62 will work in the tester (only buttons)?
The control panel from this article https://www.mql5.com/ru/articles/62 will work in the tester (buttons only)?
So try it - what's stopping it?
I just wrote how I put the pending orders in the visualiser myself.
So try it - what's stopping you?
I have simply written how I set the pending orders in the visualizer.
I'm trying it now. I didn't want to waste time, I don't need the panel in the robot's operation, I just need it for a test. Therefore, I wasn't planning to study the subject in detail.
Can you tell me why when I change code below from close[i-1] to close[i-2] the Array of Range occurs? The code was written strictly following MQL5 book, but it doesn't explain why the buffer is overrun when price is shifted by more than 2 cells.
{ int values_to_copy; int start; int calculated=BarsCalculated (iBands1_handle); if (calculated <=0) { return (0); } if (prev_calculated==0 || calculated!=bars_calculated) { start=1; if (calculated> rates_total) values_to_copy=rates_total; else values_to_copy=calculated; } else { start=rates_total-1; values_to_copy=1; } if(!FillArrayFrom_iBands1_handleBuffer(Base,Upper,Lower,iBands1_handle,values_to_copy)) return(0); for (int i=start; i <rates_total &&!IsStopped ();i++) { Print("C ", close[i-2]); }Can you tell me why when I change code below from close[i-1] to close[i-2] the Array of Range occurs? The code was written strictly following MQL5 book, but it does not describe why withdrawal from buffer occurs when price is shifted by more than 2 cells.
As far as I understand, we are talking about an indicator. So, consider two cases of accessing an array-timeseries"close": (1) what happens when"start" equals "1" and (2) what happens when"start" equals "rates_total-1".
Just calculate in your mind the resulting"close" array index if you try to do "close[i-2]" for case (1) and for case (2).
I understand that we are talking about an indicator. So, consider two cases of accessing the"close" time-series array: (1) what happens when"start" equals "1" and (2) what happens when"start" equals "rates_total-1".
Just calculate in your mind the resulting"close" array index if you try to do "close[i-2]" for case (1) and for case (2).
Thanks, I checked, there was a need to put a number greater than 1 in the start = 1 value, debugging showed that the error occurs when the close array tries to take a value from a cell that has not yet appeared at the beginning of the recalculation.
if(close[i] < Upper[i])The debugging result is as follows:
The data goes correctly, refreshing at the same rate as the price refreshes
But if we initially set such a condition:
if(close[i] > Upper[i])Then the result will be incorrect:
That is, the values of closing prices don't coincide with the current price
I cannot understand why it happens so.
Basic code block in post#8792