Questions from Beginners MQL5 MT5 MetaTrader 5 - page 876

 
Vitaly Muzichenko:

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.

  • Click above price+Ctrl - Sell Limit
  • Click below price+Ctrl -Buy Limit
  • Click above price+Ctrl+Shift - Buy Stop
  • Click below price+Ctrl+Shift - Sell Stop
You can also shift BuyStopLimit and SellStopLimit
 
Artyom Trishkin:

I am betting with the mouse.

  • Click above price+Ctrl - Sell Limit
  • Click below price+Ctrl -Buy Limit
  • Click above price+Ctrl+Shift - Buy Stop
  • Click below price+Ctrl+Shift - Sell Stop
You can also put BuyStopLimit and SellStopLimit with the shifft

The control panel from this article https://www.mql5.com/ru/articles/62 will work in the tester (only buttons)?

Создание активных панелей управления на MQL5 для торговли
Создание активных панелей управления на MQL5 для торговли
  • 2010.04.15
  • Евгений
  • www.mql5.com
Удобство имеет большое значение в работе, а тем более в работе трейдера, где скорость и точность решают многое. При подготовке терминала к работе каждый настраивает своё рабочее место максимально комфортно для себя, чтобы в максимально короткий срок можно было совершить анализ и войти в рынок. Но реальность такова, что разработчики не могут...
 
Sergey Savinkin:

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.

 
Artyom Trishkin:

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.

 
Good article, but theOnChartEvent() event is not called in the tester, the buttons don't work. Found the solution on the forum https://www.mql5.com/ru/forum/42817/page2
Использование переменных в событии OnChartEvent индикатора в тестере
Использование переменных в событии OnChartEvent индикатора в тестере
  • 2016.02.25
  • www.mql5.com
При тестировании в эксперте можно обрабатывать пользовательские события с помощью функции 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]);
   }
 
clickaider:

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).

 
Vladimir Karputov:

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


I cannot understand why it happens so.

Basic code block in post
Reason: