Posicionar un texto en el borde derecho de la pantalla

Trabalho concluído

Tempo de execução 6 minutos
Comentário do cliente
El desarrollador tiene amplios conocimientos del lenguaje mq5 y trabaja con bastante eficiencia y calidad. Lo recomiendo al 100%
Comentário do desenvolvedor
¡Un verdadero profesional y una buena persona! ¡Fue un placer trabajar! ¡Gracias por tu pedido!

Termos de Referência

Logré crear un indicador que muestra una línea en los niveles comerciales High y Low del día anterior y en la apertura del día actual, intenté añadirle un texto que defina la línea pero por mas que lo intento no logro posicionar el texto en el lugar deseado (el borde derecho de la ventana) (ver imagen adjunta). El texto sí se dibuja pero se posiciona en el tiempo actual del eje X. 

// Añadir texto para el high del día anterior
      if (ObjectFind(0, highTextName) == -1)
      {
         if (!ObjectCreate(0, highTextName, OBJ_TEXT, 0, TimeCurrent(), previous_high))
         {
            Print("Error al crear el texto del máximo del día anterior");
         }
         else
         {
            ObjectSetString(0, highTextName, OBJPROP_TEXT, "HD");
            ObjectSetInteger(0, highTextName, OBJPROP_COLOR, clrTeal);
            ObjectSetInteger(0, highTextName, OBJPROP_FONTSIZE, 8);
         }

// Añadir texto para el low del día anterior
      if (ObjectFind(0, lowTextName) == -1)
      {
         if (!ObjectCreate(0, lowTextName, OBJ_TEXT, 0, TimeCurrent(), previous_low))
         {
            Print("Error al crear el texto del mínimo del día anterior");
         }
         else
         {
            ObjectSetString(0, lowTextName, OBJPROP_TEXT, "LD");
            ObjectSetInteger(0, lowTextName, OBJPROP_COLOR, clrTeal);
            ObjectSetInteger(0, lowTextName, OBJPROP_FONTSIZE, 8);
         }

// Añadir texto para la apertura del día actual
      if (ObjectFind(0, openTextName) == -1)
      {
         if (!ObjectCreate(0, openTextName, OBJ_TEXT, 0, TimeCurrent(), current_open))
         {
            Print("Error al crear el texto de la apertura del día actual");
         }
         else
         {
            ObjectSetString(0, openTextName, OBJPROP_TEXT, "OD");
            ObjectSetInteger(0, openTextName, OBJPROP_COLOR, clrYellow);
            ObjectSetInteger(0, openTextName, OBJPROP_FONTSIZE, 8);
         }

   // Obtener el ancho del gráfico en píxeles
   long chartWidth = ChartGetInteger(0, CHART_WIDTH_IN_PIXELS);

   // Coordenadas de la línea del High
   int high_x = 0, high_y = 0;
   if (ChartTimePriceToXY(0, 0, TimeCurrent(), HighLineBuffer[0], high_x, high_y))
   {
      high_x = MathMin((int)chartWidth - 10, high_x); // Ajustar posición X
      ObjectSetInteger(0, highTextName, OBJPROP_XDISTANCE, (int)chartWidth - high_x - 10); // Ajustar posición X
      ObjectSetInteger(0, highTextName, OBJPROP_YDISTANCE, high_y);
   }

   // Coordenadas de la línea del Low
   int low_x = 0, low_y = 0;
   if (ChartTimePriceToXY(0, 0, TimeCurrent(), LowLineBuffer[0], low_x, low_y))
   {
      low_x = MathMin((int)chartWidth - 10, low_x); // Ajustar posición X
      ObjectSetInteger(0, lowTextName, OBJPROP_XDISTANCE, (int)chartWidth - low_x - 10); // Ajustar posición X
      ObjectSetInteger(0, lowTextName, OBJPROP_YDISTANCE, low_y);
   }

   // Coordenadas de la línea de Apertura
   int open_x = 0, open_y = 0;
   if (ChartTimePriceToXY(0, 0, TimeCurrent(), OpenLineBuffer[0], open_x, open_y))
   {
      open_x = MathMin((int)chartWidth - 10, open_x); // Ajustar posición X
      ObjectSetInteger(0, openTextName, OBJPROP_XDISTANCE, (int)chartWidth - open_x - 10); // Ajustar posición X
      ObjectSetInteger(0, openTextName, OBJPROP_YDISTANCE, open_y);
   }

   return rates_total;
}



¿Alguien tiene alguna idea de como podría mejorar esto?



Arquivos anexados:

Respondido

1
Desenvolvedor 1
Classificação
(554)
Projetos
641
32%
Arbitragem
41
41% / 46%
Expirado
11
2%
Carregado
2
Desenvolvedor 2
Classificação
(1)
Projetos
1
0%
Arbitragem
0
Expirado
0
Livre
3
Desenvolvedor 3
Classificação
(184)
Projetos
317
24%
Arbitragem
23
35% / 13%
Expirado
24
8%
Livre
Publicou: 3 códigos
4
Desenvolvedor 4
Classificação
(62)
Projetos
92
16%
Arbitragem
4
0% / 25%
Expirado
2
2%
Livre
5
Desenvolvedor 5
Classificação
Projetos
0
0%
Arbitragem
1
0% / 0%
Expirado
0
Trabalhando
6
Desenvolvedor 6
Classificação
(144)
Projetos
186
41%
Arbitragem
24
58% / 21%
Expirado
13
7%
Livre
7
Desenvolvedor 7
Classificação
(23)
Projetos
29
14%
Arbitragem
3
0% / 67%
Expirado
3
10%
Trabalhando
Pedidos semelhantes
Diseño simple de página web, para venta de vinos con tienda online y grupo exclusivo para clientes. Además se incorporarán otros artículos relacionados con el mundo del.vino para su venta

Informações sobre o projeto

Orçamento
30+ USD