Discusión sobre el artículo "Recetas MQL5 - Escribiendo nuestra propia profundidad de mercado" - página 5

 
Sí, versión diferente. Este artículo de 2015, contiene el código del segundo artículo de seguimiento de 2017 https://www.mql5.com/es/articles/3336. Por desgracia, no se compila. Para fines de formación, puede utilizar la base de código original de 2015, en él el cristal de precios funciona sin un gráfico. He publicado el código más arriba. En cuanto a la nueva versión, llevará algún tiempo arreglarlo.
Пишем скальперский стакан цен на основе графической библиотеки CGraphic
Пишем скальперский стакан цен на основе графической библиотеки CGraphic
  • 2017.06.23
  • www.mql5.com
В статье создается базовый функционал скальперского стакана цен. Разрабатывается тиковый график на основе графической библиотеки CGraphic и интегрируется с таблицей заявок. С помощью описываемого стакана цен можно создать мощный помощник для краткосрочной торговли.
 
Vasiliy Sokolov #:
Por desgracia, no compila.

Sólo hay un par de errores en el código adjunto a este artículo.

En el archivo MBookFon.m qh, la implementación del método no está definida correctamente - falta void:

void  CBookFon::Show(void)
{
   ObjectCreate(ChartID(), m_name, OBJ_RECTANGLE_LABEL, 0, 0, 0);
   ObjectSetInteger(ChartID(), m_name, OBJPROP_YDISTANCE, 13);
   ObjectSetInteger(ChartID(), m_name, OBJPROP_XDISTANCE, 6);
   ObjectSetInteger(ChartID(), m_name, OBJPROP_XSIZE, 116);
   ObjectSetInteger(ChartID(), m_name, OBJPROP_BORDER_TYPE, BORDER_FLAT);
   ObjectSetInteger(ChartID(), m_name, OBJPROP_BGCOLOR, clrWhite);
   int total = (int)m_book.InfoGetInteger(MBOOK_DEPTH_TOTAL);
   ObjectSetInteger(ChartID(), m_name, OBJPROP_YSIZE, total*15+16);
   CreateCeils();
   
   OnShow();
}


En el fichero MBookCeil. mqh, no hay comprobación del tamaño del array y del desbordamiento del array:

void CBookCeil::Refresh(void)
{
   int total = (int)m_book.InfoGetInteger(MBOOK_DEPTH_TOTAL);
   if(total == 0 || m_index < 0 || m_index > total-1)
      return;
   ENUM_BOOK_TYPE type = m_book.MarketBook[m_index].type;
   long max_volume = 0;
   if(type == BOOK_TYPE_BUY || type == BOOK_TYPE_BUY_MARKET)
   {
      ObjectSetInteger(ChartID(), m_name, OBJPROP_BGCOLOR, clrCornflowerBlue);
      max_volume = m_book.InfoGetInteger(MBOOK_MAX_BID_VOLUME);
   }
   else if(type == BOOK_TYPE_SELL || type == BOOK_TYPE_SELL_MARKET)
   {
      ObjectSetInteger(ChartID(), m_name, OBJPROP_BGCOLOR, clrPink);
      max_volume = m_book.InfoGetInteger(MBOOK_MAX_ASK_VOLUME);
   }
   else
      ObjectSetInteger(ChartID(), m_name, OBJPROP_BGCOLOR, clrWhite);
   MqlBookInfo info = m_book.MarketBook[m_index];
   if(m_ceil_type == BOOK_PRICE)
      m_text.SetText(DoubleToString(info.price, Digits()));
   else if(m_ceil_type == BOOK_VOLUME)
      m_text.SetText((string)info.volume);
   if(m_ceil_type != BOOK_VOLUME)return;
   double delta = 1.0;
   if(max_volume > 0)
      delta = (info.volume/(double)max_volume);
   if(delta > 1.0)delta = 1.0;   
   long size = (long)(delta * 50.0);
   if(size == 0)size = 1;
   ObjectSetInteger(ChartID(), m_name, OBJPROP_XSIZE, size);
   ObjectSetInteger(ChartID(), m_name, OBJPROP_YDISTANCE, m_ydist);
}

En la primera ejecución, cuando el cristal de precios aún no está conectado, el tamaño del array es cero y, en consecuencia, se produce el error crítico.

 
He compilado los archivos, sin embargo, todavía hay errores. ¿Puede alguien compartir una versión de trabajo por favor
 
startatrix #:
He compilado los archivos pero los errores persisten. ¿Puede alguien compartir una versión de trabajo por favor.
Si se compilan, no hay errores. Si no se puede compilar, ¿cuáles son los errores?