Новая версия платформы MetaTrader 5 build 1930: Плавающие окна графиков и .Net библиотеки в MQL5 - страница 145

 
Ни в какие ворота
0 error(s), 0 warning(s), 33357 msec elapsed            1       1
 
fxsaber:
Ни в какие ворота

Папка Config:


 
Anatoli Kazharski:

Папка Config:

Быстрее F5+ESC.

 
fxsaber:
Ни в какие ворота

Кстати да, продолжительность компиляции за последнее время как-то выросла.  Даже при Optimize=0, в старых билдах например было менее 2 секунд, теперь 5-6 секунд.

И ещё неприятный момент.  Никак не кэшируются результаты предыдущей компиляции. Даже когда мы ничего не меняя в исходниках повторно нажимаем "Компилировать", то процесс идёт с чистого листа.   Хорошо бы доработать этот момент.

 

I (b1981) have run an EA in the Debugger with real quotes (Ctrl+F5) and after the first Position was opened I checked the position history. But at this time no closed position can exist. The EA has just opened the first position which is still open:

int clean( const ulong search){   
   if ( !HistorySelect(0,TimeCurrent()) ) return(-1);// total history 
   int i, n=0, p =  HistoryOrdersTotal();
   ulong t=0;
   while(p-->0) { // returns the number of open positions
      t = HistoryOrderGetTicket(p);
      if(t<=0) continue;
      //...
   }
   //...
   return(i);
}

As you can see the functions for History.. have found the open position:

BTW this PlaySound("connect.wav"); causes an Error 5019: File not found in the Debugger

 
Carl Schreiber:

I (b1981) have run an EA in the Debugger with real quotes (Ctrl+F5) and after the first Position was opened I checked the position history. But at this time no closed position can exist. The EA has just opened the first position which is still open:

As you can see the functions for History.. have found the open position:

Вы совсем не понимаете, что такое позиции и ордера.

 
fxsaber:

Вы совсем не понимаете, что такое позиции и ордера.

?? In the reference I read that POSITION_TICKET is  the ticket of the position while POSITION_IDENTIFIER is the ID of the order. So I assume that HistoryOrdersGetTicket returns the ticket of closed orders.

But if theses function do not distinguish between Order and Position - does it mean that the only way to get closed positions by checking - what? I can't find something like ORDER_TIME_CLOSED and every open position has an ORDER_PRICE_CURRENT.

The naming of order, deal, and position is quite confusing as - I guess due to the history - they are mixed up every now and then.

 

Форум по трейдингу, автоматическим торговым системам и тестированию торговых стратегий

Баг компилятора: ambiguous call to overloaded function with the same parameters (шаблоны с указателями)

Alexey Navoykov, 2019.02.08 12:42

Ошибка компилятора.  Не может определиться между шаблонами, хотя неоднозначности тут нет.  В верхнем шаблоне указатель a должен быть неконстантным.   В C++ всё работает.

template<typename T>
void set(T*&a, T*b) { a=b; }

template<typename T>
void set(const T*&a, const T*b) { a=b; }  // Должен вызываться этот вариант

void OnStart()
{
  const void *a;
  void *b;
  
  set(a, b);  // 'set' - ambiguous call to overloaded function with the same parameters
}
 

И ещё один давний баг, который я когда-то выкладывал, но видимо он остался незамеченным:

template<typename T>
void f(T &a, const T b)  { a=b; }  // '=' - cannot convert from const pointer to nonconst pointer

void OnStart()
{
  void *a, *b;
  
  f(a, b);
}

const здесь относится к переменной, а не к типу указателя.   Т.е. шаблон должен раскрываться в:

void f(void*&a, void*const b)

а вместо этого раскрывается в:

void f(void*&a, const void*b)


Если же объявить шаблон в альтернативном виде:

template<typename T>
void f(T &a, T const b)

то компилятор вообще выдаёт ошибку  'f' - cannot to apply template ,  т.е. даже не может вызвать такой шаблон.

 
Carl Schreiber:

?? In the reference I read that POSITION_TICKET is  the ticket of the position while POSITION_IDENTIFIER is the ID of the order. So I assume that HistoryOrdersGetTicket returns the ticket of closed orders.

But if theses function do not distinguish between Order and Position - does it mean that the only way to get closed positions by checking - what? I can't find something like ORDER_TIME_CLOSED and every open position has an ORDER_PRICE_CURRENT.

The naming of order, deal, and position is quite confusing as - I guess due to the history - they are mixed up every now and then.

Вам лучше почитать вводные статьи по MT5.

Причина обращения: