Como fazer paginação de uma Label de Texto????

 

Salve galera!

Venho aqui com outra duvida...

Estou desenvolvendo um EA que analisa determinadas condições dos ativos que estão selecionados na janela de "Observações de Mercado" e são exibidas em um painel

Porém na tela cabem 25 ativos para que fique bem esteticamente, acima desse número começa a "estragar" o visual >>>> vejam a imagem "acima de 25 ativos"

No caso eu preciso criar uma "paginação" desses ativos de 25 em 25, através do texto em amarelo no rodapé já criado como pode se ver na imagem "25 ativos"

Ah e se alguem tambem puder dar uma dica de o por que a lista de ativos da tabela demora para carregar (cerca de 30 segundos ou mais) e por que quando removo da lista de EA ele não desaparece, agradeço tambem...


Segue o codigo simplificado com apenas a parte funcional da tabela e fundo para facilitar

//+------------------------------------------------------------------+
//|                                                    Retangulo.mq5 |
//|                                                      ATM SYSTEMS |
//+------------------------------------------------------------------+
#property copyright "ATM SYSTEMS"
#property link      "https://www.mql5.com"
#property version   "1.00"

// Informaçoes background da tabela                                     
 
bool RectLabelCreate(const long             chart_ID=12,               // ID do gráfico
                     const string           name="BG_tabela",         // nome da etiqueta
                     const int              sub_window=0,             // índice da sub-janela
                     const int              x=0,                      // coordenada X predefinida
                     const int              y=0,                      // coordenada Y predefinida
                     const int              width=50,                 // largura predefinida
                     const int              height=18,                // altura predefinida
                     const color            back_clr=C'236,233,216',  // cor do fundo
                     const ENUM_BORDER_TYPE border=BORDER_SUNKEN,     // tipo de borda
                     const ENUM_BASE_CORNER corner=CORNER_LEFT_UPPER, // canto do gráfico para ancoragem
                     const color            clr=clrRed,               // cor da borda plana (Flat)
                     const ENUM_LINE_STYLE  style=STYLE_SOLID,        // estilo da borda plana
                     const int              line_width=1,             // largura da borda plana
                     const bool             back=false,               // no fundo
                     const bool             selection=false,          // destaque para mover
                     const bool             hidden=true,              // ocultar na lista de objeto
                     const long             z_order=-1)                // prioridade para clicar no mouse
  {
//--- redefine o valor de erro
   ResetLastError();
//--- criar uma etiqueta retangular
   if(!ObjectCreate(chart_ID,name,OBJ_RECTANGLE_LABEL,sub_window,0,0))
     {
      Print(__FUNCTION__,
            ": falha ao criar uma etiqueta retangular! Código de erro = ",GetLastError());
      return(false);
     }
//--- definir coordenadas da etiqueta
   ObjectSetInteger(chart_ID,name,OBJPROP_XDISTANCE,x);
   ObjectSetInteger(chart_ID,name,OBJPROP_YDISTANCE,y);
//--- definir tamanho da etiqueta
   ObjectSetInteger(chart_ID,name,OBJPROP_XSIZE,width);
   ObjectSetInteger(chart_ID,name,OBJPROP_YSIZE,height);
//--- definir a cor de fundo
   ObjectSetInteger(chart_ID,name,OBJPROP_BGCOLOR,back_clr);
//--- definir o tipo de borda
   ObjectSetInteger(chart_ID,name,OBJPROP_BORDER_TYPE,border);
//--- determinar o canto do gráfico onde as coordenadas do ponto são definidas
   ObjectSetInteger(chart_ID,name,OBJPROP_CORNER,corner);
//--- definir a cor da borda plana (no modo Flat)
   ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clr);
//--- definir o estilo da linha da borda plana
   ObjectSetInteger(chart_ID,name,OBJPROP_STYLE,style);
//--- definir a largura da borda plana
   ObjectSetInteger(chart_ID,name,OBJPROP_WIDTH,line_width);
//--- exibir em primeiro plano (false) ou fundo (true)
   ObjectSetInteger(chart_ID,name,OBJPROP_BACK,back);
//--- Habilitar (true) ou desabilitar (false) o modo de movimento da etiqueta pelo mouse
   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,selection);
   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,selection);
//--- ocultar (true) ou exibir (false) o nome do objeto gráfico na lista de objeto 
   ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,hidden);
//--- definir a prioridade para receber o evento com um clique do mouse no gráfico
   ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,z_order);
//--- sucesso na execução
   return(true);
  }

// Fim das Informacoes de background


// Inicio Informações tabela
// variaveis que já existem mas repetidas nesse arquivo com o fim de parametrizar dados
//input group "Configuraçoes de Período"
ENUM_TIMEFRAMES    inpt_timeframe_1        = PERIOD_M5;
ENUM_TIMEFRAMES    inpt_timeframe_2        = PERIOD_M15;
ENUM_TIMEFRAMES    inpt_timeframe_3        = PERIOD_H1;


string symbolName[]; // array of symbols after merging post and prefix



//variables for bounced check alerts
string index_tf1="AtivoCampo_tf1"+EnumToString(inpt_timeframe_1);
string index_tf2="AtivoCampo_tf2"+EnumToString(inpt_timeframe_2);
string index_tf3="AtivoCampo_tf3"+EnumToString(inpt_timeframe_3);

//Entradas e variaveis da tabela 
int widthX_tabela_tf1=50;// era 40
int widthX_tabela_tf2=270;// era 260
int widthX_tabela_tf3=490;// era 480
int heightY_tabela=50;
int dist_ativoXtipo=85;// Ativo <--> Tipo
int dist_tipoXnivel1=65;// Tipo  <--> Nivel 1
int dist_nivel1Xnivel2=70;// Tendência <--> Nivel 2
string FontHeader="Verdana";//Fonte dos cabeçalhos 
string Font="Arial";//fonte dos textos
int fontText=9;//tamanho da fonte dos textos
int textH=16;//espacamento entre linhas
input color headerColors=clrYellow;//Cor do Título
input color CorAtivos=clrDeepSkyBlue;//Cor dos Ativos
input color CorLinhas=clrWhite;//Cor dos Alertas
int textHEnd=0;

// Fim inicio Informações tabela

//###############################################################################################################################
int OnInit()
  {

// Background da tabela     
//--- definir as coordenadas da etiqueta retangular
   int x_pos_RectLabel=25;
   int y_pos_RectLabel=25;
//--- definir tamanho da etiqueta
   int width_RectLabel=750;
   int height_RectLabel=450;
//--- criar uma etiqueta retangular
      
   if(!RectLabelCreate(0,"RectLabel",0,x_pos_RectLabel,y_pos_RectLabel,width_RectLabel,height_RectLabel,clrBlack,BORDER_FLAT,CORNER_LEFT_UPPER,
      clrWhite,STYLE_SOLID,2,false,false,true,99))
     {
      return false;
     }

// Fim da Inicializacao do background tabela   

// Inicializacao tabela

// Verificação de erro tabela e carregamento dos simbolos
   
      if(EventSetTimer(5)==false)
     {
      Alert("ERROR CODE: "+(string)GetLastError());//verifique o código de erro do temporizador
     }
   IndicatorSetString(INDICATOR_SHORTNAME,index_tf1);//nome do indicador usado para quando o erro de símbolo não encontrado removerá o indicador do gráfico
   ObjectsDeleteAll(0,index_tf1,0,OBJ_LABEL) ;
   
   
//---
   return(INIT_SUCCEEDED);
  }

//###############################################################################################################################
void OnDeinit(const int reason)
  {
//---
   
  }


//###############################################################################################################################
void OnTick()
  {

ExibirInstrumentosAtivos();
CreateLabels();
   
  }
  
//+------------------------------------------------------------------+

//###############################################################################################################################
void ExibirInstrumentosAtivos()
  {
  
// carregamento dos ativos do Observações de mercado

      int totalSymbols=SymbolsTotal(true);
      ArrayResize(symbolName,totalSymbols);
      for(int i=0; i<totalSymbols; i++)
        {
         symbolName[i]=SymbolName(i,true);
        }
// Fim carregamento dos ativos do Observações de mercado
  
  }
  
  
//###############################################################################################################################
void CreateLabels()
  {

// criando os headers tf1
      LabelCreate(0,index_tf1+" TimeframeHeader ",0,widthX_tabela_tf1+130,heightY_tabela-5-textH,CORNER_LEFT_UPPER," - "+EnumToString(inpt_timeframe_1)+" - ",FontHeader,fontText,headerColors,0.0,ANCHOR_LEFT_UPPER,false,false,true,0);
      LabelCreate(0,index_tf1+" AtivoHeader ",0,widthX_tabela_tf1+10,heightY_tabela,CORNER_LEFT_UPPER,"Ativo",FontHeader,fontText,headerColors,0.0,ANCHOR_LEFT_UPPER,false,false,true,0);
      LabelCreate(0,index_tf1+" TipoHeader ",0,widthX_tabela_tf1+18+dist_ativoXtipo,heightY_tabela,CORNER_LEFT_UPPER,"Tipo",FontHeader,fontText,headerColors,0.0,ANCHOR_LEFT_UPPER,false,false,true,0);
      LabelCreate(0,index_tf1+" Nivel_1_Header ",0,widthX_tabela_tf1+15+dist_ativoXtipo+dist_tipoXnivel1,heightY_tabela,CORNER_LEFT_UPPER,"Nivel 1",FontHeader,fontText,headerColors,0.0,ANCHOR_LEFT_UPPER,false,false,true,0);
      LabelCreate(0,index_tf1+" Nivel_2_Header ",0,widthX_tabela_tf1+13+dist_ativoXtipo+dist_tipoXnivel1+dist_nivel1Xnivel2,heightY_tabela,CORNER_LEFT_UPPER,"Nivel 2",FontHeader,fontText,headerColors,0.0,ANCHOR_LEFT_UPPER,false,false,true,0);
//
// criando os headers tf2
      LabelCreate(0,index_tf2+" TimeframeHeader ",0,widthX_tabela_tf2+130,heightY_tabela-5-textH,CORNER_LEFT_UPPER," - "+EnumToString(inpt_timeframe_2)+" - ",FontHeader,fontText,headerColors,0.0,ANCHOR_LEFT_UPPER,false,false,true,0);
      LabelCreate(0,index_tf2+" TipoHeader ",0,widthX_tabela_tf2+18+dist_ativoXtipo,heightY_tabela,CORNER_LEFT_UPPER,"Tipo",FontHeader,fontText,headerColors,0.0,ANCHOR_LEFT_UPPER,false,false,true,0);
      LabelCreate(0,index_tf2+" Nivel_1_Header ",0,widthX_tabela_tf2+15+dist_ativoXtipo+dist_tipoXnivel1,heightY_tabela,CORNER_LEFT_UPPER,"Nivel 1",FontHeader,fontText,headerColors,0.0,ANCHOR_LEFT_UPPER,false,false,true,0);
      LabelCreate(0,index_tf2+" Nivel_2_Header ",0,widthX_tabela_tf2+13+dist_ativoXtipo+dist_tipoXnivel1+dist_nivel1Xnivel2,heightY_tabela,CORNER_LEFT_UPPER,"Nivel 2",FontHeader,fontText,headerColors,0.0,ANCHOR_LEFT_UPPER,false,false,true,0);

// criando os headers tf3
      LabelCreate(0,index_tf3+" TimeframeHeader ",0,widthX_tabela_tf3+130,heightY_tabela-5-textH,CORNER_LEFT_UPPER," - "+EnumToString(inpt_timeframe_3)+" - ",FontHeader,fontText,headerColors,0.0,ANCHOR_LEFT_UPPER,false,false,true,0);
      LabelCreate(0,index_tf3+" TipoHeader ",0,widthX_tabela_tf3+18+dist_ativoXtipo,heightY_tabela,CORNER_LEFT_UPPER,"Tipo",FontHeader,fontText,headerColors,0.0,ANCHOR_LEFT_UPPER,false,false,true,0);
      LabelCreate(0,index_tf3+" Nivel_1_Header ",0,widthX_tabela_tf3+15+dist_ativoXtipo+dist_tipoXnivel1,heightY_tabela,CORNER_LEFT_UPPER,"Nivel 1",FontHeader,fontText,headerColors,0.0,ANCHOR_LEFT_UPPER,false,false,true,0);
      LabelCreate(0,index_tf3+" Nivel_2_Header ",0,widthX_tabela_tf3+13+dist_ativoXtipo+dist_tipoXnivel1+dist_nivel1Xnivel2,heightY_tabela,CORNER_LEFT_UPPER,"Nivel 2",FontHeader,fontText,headerColors,0.0,ANCHOR_LEFT_UPPER,false,false,true,0);

// Criando o footer
      LabelCreate(0,index_tf3+" Footer1 ",0,widthX_tabela_tf3+18+dist_ativoXtipo,heightY_tabela+430,CORNER_LEFT_UPPER,"<< Anterior",FontHeader,fontText,headerColors,0.0,ANCHOR_LEFT_UPPER,false,false,true,0);
      LabelCreate(0,index_tf3+" Footer2 ",0,widthX_tabela_tf3+120+dist_ativoXtipo,heightY_tabela+430,CORNER_LEFT_UPPER,"Próxima >>",FontHeader,fontText,headerColors,0.0,ANCHOR_LEFT_UPPER,false,false,true,0);

   int textSpaceing=textH;


// capturar aqui os valores das condicionais de comparação    

      string Tipo_tf1; //essa variavel devera vir ATRELADA AO NOME DO ATIVO das linhas de verificação das condicionais de compra ou venda
      string Cond_Nivel_1_tf1; //essa variavel devera vir ATRELADA AO NOME DO ATIVO das linhas de verificação das condicionais de nivel 1
      string Cond_Nivel_2_tf1; //essa variavel devera vir ATRELADA AO NOME DO ATIVO das linhas de verificação das condicionais de nivel 2
      string Tipo_tf2; //essa variavel devera vir ATRELADA AO NOME DO ATIVO das linhas de verificação das condicionais de compra ou venda
      string Cond_Nivel_1_tf2; //essa variavel devera vir ATRELADA AO NOME DO ATIVO das linhas de verificação das condicionais de nivel 1
      string Cond_Nivel_2_tf2; //essa variavel devera vir ATRELADA AO NOME DO ATIVO das linhas de verificação das condicionais de nivel 2
      string Tipo_tf3; //essa variavel devera vir ATRELADA AO NOME DO ATIVO das linhas de verificação das condicionais de compra ou venda
      string Cond_Nivel_1_tf3; //essa variavel devera vir ATRELADA AO NOME DO ATIVO das linhas de verificação das condicionais de nivel 1
      string Cond_Nivel_2_tf3; //essa variavel devera vir ATRELADA AO NOME DO ATIVO das linhas de verificação das condicionais de nivel 2
      Tipo_tf1  = "  VENDA"; //definido apenas para exibir como teste - UTILIZAR "COMPRA" E "  VENDA" << -- NÃO DESCARTAR OS ESPAÇOS!!!!
      Cond_Nivel_1_tf1 = "  - - -  "; //definido apenas para exibir como teste - UTILIZAR "SIM" E "  - - -  " << -- NÃO DESCARTAR OS ESPAÇOS!!!!
      Cond_Nivel_2_tf1 = "  - - -  "; //definido apenas para exibir como teste - UTILIZAR "SIM" E "  - - -  " << -- NÃO DESCARTAR OS ESPAÇOS!!!!
      Tipo_tf2  = "  VENDA"; //definido apenas para exibir como teste - UTILIZAR "COMPRA" E "  VENDA" << -- NÃO DESCARTAR OS ESPAÇOS!!!!
      Cond_Nivel_1_tf2 = "  - - -  "; //definido apenas para exibir como teste - UTILIZAR "SIM" E "  - - -  " << -- NÃO DESCARTAR OS ESPAÇOS!!!!
      Cond_Nivel_2_tf2 = "  - - -  "; //definido apenas para exibir como teste - UTILIZAR "SIM" E "  - - -  " << -- NÃO DESCARTAR OS ESPAÇOS!!!!
      Tipo_tf3  = "  VENDA"; //definido apenas para exibir como teste - UTILIZAR "COMPRA" E "  VENDA" << -- NÃO DESCARTAR OS ESPAÇOS!!!!
      Cond_Nivel_1_tf3 = "  - - -  "; //definido apenas para exibir como teste - UTILIZAR "SIM" E "  - - -  " << -- NÃO DESCARTAR OS ESPAÇOS!!!!
      Cond_Nivel_2_tf3 = "  - - -  "; //definido apenas para exibir como teste - UTILIZAR "SIM" E "  - - -  " << -- NÃO DESCARTAR OS ESPAÇOS!!!!

//Criando as linhas
   for(int i=0; i<ArraySize(symbolName); i++)
     {
      LabelCreate(0,index_tf1+" ativo "+symbolName[i]+" symbol ",0,widthX_tabela_tf1,heightY_tabela+textSpaceing,CORNER_LEFT_UPPER,symbolName[i],Font,fontText,CorAtivos,0.0,ANCHOR_LEFT_UPPER,false,false,true,0);

//linhas da coluna tf1
      LabelCreate(0,index_tf1+" tipo1 "+symbolName[i]+" pivot1 ",0,(widthX_tabela_tf1+5)+dist_ativoXtipo,heightY_tabela+textSpaceing,CORNER_LEFT_UPPER,Tipo_tf1,Font,fontText,CorLinhas,0.0,ANCHOR_LEFT_UPPER,false,false,true,0);
      LabelCreate(0,index_tf1+" nivel1 "+symbolName[i]+" pivotAlert1 ",0,(widthX_tabela_tf1+18)+dist_ativoXtipo+dist_tipoXnivel1,heightY_tabela+textSpaceing,CORNER_LEFT_UPPER,Cond_Nivel_1_tf1,Font,fontText,CorLinhas,0.0,ANCHOR_LEFT_UPPER,false,false,true,0);
      LabelCreate(0,index_tf1+" nivel2 "+symbolName[i]+" timeAlert1 ",0,(widthX_tabela_tf1+15)+dist_ativoXtipo+dist_tipoXnivel1+dist_nivel1Xnivel2,heightY_tabela+textSpaceing,CORNER_LEFT_UPPER,Cond_Nivel_2_tf1,Font,fontText,CorLinhas,0.0,ANCHOR_LEFT_UPPER,false,false,true,0);
      LabelCreate(0,index_tf1+" divisao1 "+symbolName[i]+" | ",0,(widthX_tabela_tf1+65)+dist_ativoXtipo+dist_tipoXnivel1+dist_nivel1Xnivel2,heightY_tabela+textSpaceing,CORNER_LEFT_UPPER," | ",Font,fontText,CorLinhas,0.0,ANCHOR_LEFT_UPPER,false,false,true,0);

//linhas da coluna tf2
      LabelCreate(0,index_tf2+" tipo2 "+symbolName[i]+" pivot2 ",0,(widthX_tabela_tf2+5)+dist_ativoXtipo,heightY_tabela+textSpaceing,CORNER_LEFT_UPPER,Tipo_tf2,Font,fontText,CorLinhas,0.0,ANCHOR_LEFT_UPPER,false,false,true,0);
      LabelCreate(0,index_tf2+" nivel1 "+symbolName[i]+" pivotAlert2 ",0,(widthX_tabela_tf2+18)+dist_ativoXtipo+dist_tipoXnivel1,heightY_tabela+textSpaceing,CORNER_LEFT_UPPER,Cond_Nivel_1_tf2,Font,fontText,CorLinhas,0.0,ANCHOR_LEFT_UPPER,false,false,true,0);
      LabelCreate(0,index_tf2+" nivel2 "+symbolName[i]+" timeAlert2 ",0,(widthX_tabela_tf2+15)+dist_ativoXtipo+dist_tipoXnivel1+dist_nivel1Xnivel2,heightY_tabela+textSpaceing,CORNER_LEFT_UPPER,Cond_Nivel_2_tf3,Font,fontText,CorLinhas,0.0,ANCHOR_LEFT_UPPER,false,false,true,0);
      LabelCreate(0,index_tf1+" divisao2 "+symbolName[i]+" | ",0,(widthX_tabela_tf1+285)+dist_ativoXtipo+dist_tipoXnivel1+dist_nivel1Xnivel2,heightY_tabela+textSpaceing,CORNER_LEFT_UPPER," | ",Font,fontText,CorLinhas,0.0,ANCHOR_LEFT_UPPER,false,false,true,0);

      
//linhas da coluna tf3
      LabelCreate(0,index_tf3+" tipo3 "+symbolName[i]+" pivot3 ",0,(widthX_tabela_tf3+5)+dist_ativoXtipo,heightY_tabela+textSpaceing,CORNER_LEFT_UPPER,Tipo_tf3,Font,fontText,CorLinhas,0.0,ANCHOR_LEFT_UPPER,false,false,true,0);
      LabelCreate(0,index_tf3+" nivel1 "+symbolName[i]+" pivotAlert3 ",0,(widthX_tabela_tf3+18)+dist_ativoXtipo+dist_tipoXnivel1,heightY_tabela+textSpaceing,CORNER_LEFT_UPPER,Cond_Nivel_1_tf3,Font,fontText,CorLinhas,0.0,ANCHOR_LEFT_UPPER,false,false,true,0);
      LabelCreate(0,index_tf3+" nivel2 "+symbolName[i]+" timeAlert3 ",0,(widthX_tabela_tf3+15)+dist_ativoXtipo+dist_tipoXnivel1+dist_nivel1Xnivel2,heightY_tabela+textSpaceing,CORNER_LEFT_UPPER,Cond_Nivel_2_tf3,Font,fontText,CorLinhas,0.0,ANCHOR_LEFT_UPPER,false,false,true,0);
      
      textSpaceing+=textH;

     }

  } 
  
bool LabelCreate(const long              chart_ID=75,              // chart's ID
                 const string            name="Tabela",            // nome
                 const int               sub_window=0,             // subwindow index_tf1
                 const int               x=0,                      // X coordinate
                 const int               y=0,                      // Y coordinate
                 const ENUM_BASE_CORNER  corner=CORNER_LEFT_UPPER, // chart corner for anchoring
                 const string            text="Label02",           // text
                 const string            font="Arial",             // font
                 const int               font_size=10,             // font size
                 const color             clr=clrRed,               // color
                 const double            angle=0.0,                // text slope
                 const ENUM_ANCHOR_POINT anchor=ANCHOR_LEFT_UPPER, // anchor type
                 const bool              back=false,               // in the background
                 const bool              selection=false,          // highlight to move
                 const bool              hidden=true,              // hidden in the object list
                 const long              z_order=0)                // priority for mouse click
  {
//--- reset o valor de erro
   ResetLastError();
   
//--- criando etiqueta de texto
   if(!ObjectCreate(chart_ID,name,OBJ_LABEL,sub_window,0,0))
     {
      Print(__FUNCTION__,
            ": falha ao criar tabela! Código de erro: ",GetLastError());
      return(false);
     }
//--- definir as coordenadas
   ObjectSetInteger(chart_ID,name,OBJPROP_XDISTANCE,x);
   ObjectSetInteger(chart_ID,name,OBJPROP_YDISTANCE,y);
//--- definir o canto do gráfico, em relação ao qual as coordenadas do ponto são definidas
   ObjectSetInteger(chart_ID,name,OBJPROP_CORNER,corner);
//--- definir o texto
   ObjectSetString(chart_ID,name,OBJPROP_TEXT,text);
//--- definir a fonte
   ObjectSetString(chart_ID,name,OBJPROP_FONT,font);
//--- definir tamanho da fonte
   ObjectSetInteger(chart_ID,name,OBJPROP_FONTSIZE,font_size);
//--- definir o ângulo de inclinação do texto
   ObjectSetDouble(chart_ID,name,OBJPROP_ANGLE,angle);
//--- definir tipo de âncora
   ObjectSetInteger(chart_ID,name,OBJPROP_ANCHOR,anchor);
//--- definir cor
   ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clr);
//--- exibir em primeiro plano (false) ou em segundo plano (true)
   ObjectSetInteger(chart_ID,name,OBJPROP_BACK,back);
//--- habilitar (true) ou desabilitar (false) o modo de mover o rótulo com o mouse
   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,selection);
   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,selection);
//--- exibir em primeiro plano (false) ou em segundo plano (true) 
   ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,hidden);
//--- definir a prioridade para receber o evento de um clique do mouse no gráfico
   ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,z_order);
 
   return(true);
  }


  

Arquivos anexados:
 
Alexandre Molina:

Salve galera!

Venho aqui com outra duvida...

Estou desenvolvendo um EA que analisa determinadas condições dos ativos que estão selecionados na janela de "Observações de Mercado" e são exibidas em um painel

Porém na tela cabem 25 ativos para que fique bem esteticamente, acima desse número começa a "estragar" o visual >>>> vejam a imagem "acima de 25 ativos"

No caso eu preciso criar uma "paginação" desses ativos de 25 em 25, através do texto em amarelo no rodapé já criado como pode se ver na imagem "25 ativos"

Ah e se alguem tambem puder dar uma dica de o por que a lista de ativos da tabela demora para carregar (cerca de 30 segundos ou mais) e por que quando removo da lista de EA ele não desaparece, agradeço tambem...


Segue o codigo simplificado com apenas a parte funcional da tabela e fundo para facilitar


  

Não é bem assim a forma. Tu vai criar os 25 que cabem fixo e se tiver menos tu popula com algo invisivel que não aparece na tela. Quanto tem mais de 25 tu vai ter que ter um botão pra fazer esse controle de mais ou menos, tu tambem poderia pensar em trabalhar com abas sempre visiveis. Tem excelentes artigos aqui no site sobre interface que dão ideias próximas. Tem até uns explicando como usar tabelas em janelas, veja: https://www.mql5.com/pt/articles/3394
Graphical Interfaces XI: Text edit boxes and Combo boxes in table cells (build 15)
Graphical Interfaces XI: Text edit boxes and Combo boxes in table cells (build 15)
  • www.mql5.com
In this update of the library, the Table control (the CTable class) will be supplemented with new options. The lineup of controls in the table cells is expanded, this time adding text edit boxes and combo boxes. As an addition, this update also introduces the ability to resize the window of an MQL application during its runtime.
 
Ricardo Rodrigues Lucca #:
Não é bem assim a forma. Tu vai criar os 25 que cabem fixo e se tiver menos tu popula com algo invisivel que não aparece na tela. Quanto tem mais de 25 tu vai ter que ter um botão pra fazer esse controle de mais ou menos, tu tambem poderia pensar em trabalhar com abas sempre visiveis. Tem excelentes artigos aqui no site sobre interface que dão ideias próximas. Tem até uns explicando como usar tabelas em janelas, veja: https://www.mql5.com/pt/articles/3394

Essa de abas é interessante hein??? Vou dar uma olhada pra ver o que acho..
Obrigado pela ajuda!

 
Ricardo Rodrigues Lucca #:
Não é bem assim a forma. Tu vai criar os 25 que cabem fixo e se tiver menos tu popula com algo invisivel que não aparece na tela. Quanto tem mais de 25 tu vai ter que ter um botão pra fazer esse controle de mais ou menos, tu tambem poderia pensar em trabalhar com abas sempre visiveis. Tem excelentes artigos aqui no site sobre interface que dão ideias próximas. Tem até uns explicando como usar tabelas em janelas, veja: https://www.mql5.com/pt/articles/339

 Ricardo obrigado pelo pontapé inicial! Achei algumas coisas e ontem consegui fazer as paginas!
Nada como umas variaveis no escopo global, um loop para popular as etiquetas/tabela e uma funcao em onchartevent e pronto tabela funcionando! ver arquivo "tabela finalizando.jpg" 
ainda falta uns toques mas está bem adiantado!

Agora vou abrir um topico para descobrir o por que está lento para inicializar e trocar de paginas que não consegui descobrir...

Muito obrigado 
Deus abençoe!!

ESCOPO GLOBAL

//variaveis para paginas de ativos exibidos e create label
int currentPage = 0; // Current page index
int totalSymbols_Var = SymbolsTotal(true);
int symbolsPerPage = 25; // Number of symbols displayed per page
int totalPages = (totalSymbols_Var + symbolsPerPage - 1) / symbolsPerPage;


FUNÇÃO EXIBIR ATIVOS

void ExibirInstrumentosAtivos()
{
    int totalSymbols = SymbolsTotal(true);
    int startIndex = currentPage * symbolsPerPage;
    int endIndex = MathMin(startIndex + symbolsPerPage, totalSymbols);

    ArrayResize(symbolName, endIndex - startIndex);
    for (int i = startIndex; i < endIndex; i++)
    {
        symbolName[i - startIndex] = SymbolName(i, true);
    }
}


FUNÇÃO EM ONCHARTEVENT

if (id == CHARTEVENT_OBJECT_CLICK)
    {
        if (sparam == "PreviousPage" )
        {
            if (currentPage > 0)
               {
                currentPage--;
                ExibirInstrumentosAtivos();
                ObjectsDeleteAll(0,index_tf1,0,OBJ_LABEL);
                ObjectsDeleteAll(0,index_tf2,0,OBJ_LABEL);
                ObjectsDeleteAll(0,index_tf3,0,OBJ_LABEL);
                ObjectsDeleteAll(0, "PageInfoLabel", 0, OBJ_LABEL);
                CreateLabels();
                //Print("Pagina : ",currentPage," de: ",totalPages);
               }
        }
        else if (sparam == "NextPage")
        {
            if (currentPage < totalPages - 1)
            {
                currentPage++;
                ExibirInstrumentosAtivos();
                ObjectsDeleteAll(0,index_tf1,0,OBJ_LABEL);
                ObjectsDeleteAll(0,index_tf2,0,OBJ_LABEL);
                ObjectsDeleteAll(0,index_tf3,0,OBJ_LABEL);
                ObjectsDeleteAll(0, "PageInfoLabel", 0, OBJ_LABEL);
                CreateLabels();
            }
        }
    }
}
Arquivos anexados:
 
Alexandre Molina #:

 Ricardo obrigado pelo pontapé inicial! Achei algumas coisas e ontem consegui fazer as paginas!
Nada como umas variaveis no escopo global, um loop para popular as etiquetas/tabela e uma funcao em onchartevent e pronto tabela funcionando! ver arquivo "tabela finalizando.jpg" 
ainda falta uns toques mas está bem adiantado!

Agora vou abrir um topico para descobrir o por que está lento para inicializar e trocar de paginas que não consegui descobrir...

Muito obrigado 
Deus abençoe!!

Parabéns!