Errors, bugs, questions - page 215

 

Couldn't it still be possible to print the selected fragment in Yeditor? Right now this radio button is not active.

A small thing, of course, but unpleasant, especially when the listings are 50 pages long.

 

The server seems to have frozen... since yesterday.

 

The genetic algorithm has disappeared somewhere... Build 360

Question removed! Looking in the wrong place!

 

Can we rely on the fact that HistorySelectByPosition() returns an ORDERED list of deals?

ulong CExpertAdvisor::GetDealByOrder(ulong order) // получение тикета сделки по тикету ордера
  {
   PositionSelect(m_smb);
   HistorySelectByPosition(PositionGetInteger(POSITION_IDENTIFIER));
   uint total=HistoryDealsTotal();
//   for(uint i=0; i<total; i++)
   for(uint i=total-1; i>=0; i--)
     {
      ulong deal=HistoryDealGetTicket(i);
      if(order==HistoryDealGetInteger(deal,DEAL_ORDER))
         return(deal);                            // запомнили тикет сделки 
     }
   return(0);
  } 

Then the enumeration HERE would be unnecessary. If not, the enumeration can start from the end ... (noticed that the trades in the tester were ordered).

 

Dear Sirs Developers and programmers! I need help! Maybe I'm not the first, but still...

1. How it is possible to organize a loop, which would be interrupted (for example) when pressing on the object "button". As far as I understand, the OnChartEvent function cannot be forcibly called from the same loop? If so, maybe there are some ways around this, because I've already racked my brains.

When the loop is running, the system variables are not updated, i.e. it is not possible to take advantage of the graph period change (at least). If the loop is organized by checking OnChartEvent, then it is necessary to constantly do something with the chart to trigger this function - also not an option.

2. Is it possible to move the chart in the chart window programmatically, not only manually? ChartNavigate either does not work, or it is designed for something else, or I have not figured out how it works.

I thank you in advance.

p.s. Would it be possible to make own functions and variables highlighted in the program text?

 
KffAlex:

1. How can a loop be set up to be interrupted (for example) when a "button" object is pressed? I understand that the OnChartEvent function cannot be forcibly called from the same loop? If so, maybe there are some ways around it, because I've already racked my brains.

Check the state of the button object.
 
KffAlex:

ChartNavigate either doesn't work, or it's designed for something else, or I haven't figured out how this one works.

Try ChartRedraw after the function call and make sure that autoscrolling on the chart is disabled...
Документация по MQL5: Основы языка / Функции / Вызов функции
Документация по MQL5: Основы языка / Функции / Вызов функции
  • www.mql5.com
Основы языка / Функции / Вызов функции - Документация по MQL5
 

I have installed MT5 on a dedicated remote server. From time to time I have to make sure that the terminal reconnects to a server if the connection is interrupted for a short period of time. Be sure to specify which server to use, otherwise the entire trade "freezes". How can I make the terminal automatically reconnect if it is not connected within 5 minutes, for example?

 
EvgeTrofi:

I have installed MT5 on a dedicated remote server. From time to time I have to make sure that the terminal reconnects to a server if the connection is interrupted for a short period of time. Be sure to specify which server to use, otherwise the entire trade "freezes". How can I make terminal automatically reconnect if it is not connected in 5 minutes, for example?

This should happen automatically.

Terminal automatically detects loss of connection and reconnects to it (when this feature is available).

If this does not happen, write a request to Service Desk with a full description of the problem and do not forget to attach the logs.

 

Faced with a call stack overflow problem (I think).

After calling a method of one of the objects , see example below. The code is simplified, just the gist. Class CClass1 is a base class, and list1 has different objects that are descendants of this class, and their init functions have different implementations. So, in one class where the init function fetches such a list (to put it simply, it initializes a nested interface, a panel in the panel) after returning from init in the line

    Print(t.name);

there is an error

2010.12.02 00:21:00 test1 (EURUSD,H1) Invalid pointer access in 'Container.mqh' (74,10)

for(CClass1* t = list1.GetLastNode(); t != NULL; t = list1.GetPrevNode() ) {
   t.init(); //после выхода отсюда t-мертвый указатель
    Print(t.name); 
}

I.e. pointer t is dead.

When debugging, this error doesn't occur, after calling the method, the pointer is "alive", nested interfaces are created and EA continues to work.

The only way to bypass the error

savePoint = t;
t.init();
t = savePoint;
#property stacksize pointer achieved nothing.
Reason: