![MQL5 - Linguagem para estratégias de negociação inseridas no terminal do cliente MetaTrader 5](https://c.mql5.com/i/registerlandings/logo-2.png)
Você está perdendo oportunidades de negociação:
- Aplicativos de negociação gratuitos
- 8 000+ sinais para cópia
- Notícias econômicas para análise dos mercados financeiros
Registro
Login
Você concorda com a política do site e com os termos de uso
Se você não tem uma conta, por favor registre-se
Olá !
Ajude-me a fixar o código para que as legendas das barras fiquem no centro da barra acima da barra alta e não na lateral
#propriedade rigorosaProva: Imprimir ("Previous job PriceAsk-",PriceAsk); o log está vazio.
Sem detalhes, não é uma prova )))) Mostre-me o texto completo do init e a declaração das variáveis.
Além disso, por que verificar TODOS os pedidos, desde o início da vida da conta, se você precisa do mais recente? - Como fazer isso, se há 10 pares de moedas abertos?
Você tem que passar por eles desde o final e sair do ciclo a tempo. O que tem 10 pares a ver com isso? Mesmo uma centena, você tem um símbolo à sua escolha.
Olá !
Ajude-me a corrigir o código para que as inscrições acima das barras fiquem no centro da barra acima da barra alta e não na lateral
Aprenda como usar o botão SRC para inserir código.
E leia sobre OBJPROP_ANCHOR.
Aprenda como usar o botão SRC para inserir código.
E leia sobre OBJPROP_ANCHOR.
Consegui!
Desculpe a brusquidão !
Entendi, obrigado!
Desculpe pela dureza!
#property indicator_chart_window
input int TextSize = 8; //размер шрифта
input color TextColor = clrYellow; //цвет текста
input int TextAngle = 90; //угол поворота текста
input int MaxBar = 100; //количество баров, начиная с 0, для которых вычисляется размер свечей
int OnInit()
{
return(INIT_SUCCEEDED);
}
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
{
int i;
for ( i = 0; i < MaxBar; i++ ) {
if ( ObjectFind ("candlesize"+ IntegerToString(i)) >=0 ) {
ObjectDelete("candlesize"+ IntegerToString(i));
}
ObjectCreate ("candlesize"+ IntegerToString(i),
OBJ_TEXT,
0,
time[i],
high[i]+StepPer()*Point);
//--- установим привязку к правому верхнему углу
ObjectSetInteger(ChartID(),"candlesize"+IntegerToString(i),OBJPROP_ANCHOR,ANCHOR_UPPER);
ObjectSet ( "candlesize"+IntegerToString(i),
OBJPROP_ANGLE,
TextAngle
);
ObjectSetText ( "candlesize"+IntegerToString(i),
DoubleToStr(NormalizeDouble((high[i]-low[i]+Point)/Point, 0), 0),
TextSize,
NULL,
TextColor
);
}
return(rates_total);
}
int StepPer ()
{
int i = 0;
switch (Period())
{
case PERIOD_M1:
i = 5;
break;
case PERIOD_M5:
i = 15;
break;
case PERIOD_M15:
i = 25;
break;
case PERIOD_M30:
i = 40;
break;
case PERIOD_H1:
i = 60;
break;
case PERIOD_H4:
i = 90;
break;
case PERIOD_D1:
i = 220;
break;
case PERIOD_W1:
i = 500;
break;
case PERIOD_MN1:
i = 2000;
break;
default:
break;
}
return (i);
}
#property indicator_chart_window
input int TextSize = 8; //размер шрифта
input color TextColor = clrYellow; //цвет текста
input int TextAngle = 90; //угол поворота текста
input int MaxBar = 100; //количество баров, начиная с 0, для которых вычисляется размер свечей
int OnInit()
{
return(INIT_SUCCEEDED);
}
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
{
int i;
for ( i = 0; i < MaxBar; i++ ) {
if ( ObjectFind ("candlesize"+ IntegerToString(i)) >=0 ) {
ObjectDelete("candlesize"+ IntegerToString(i));
}
ObjectCreate ("candlesize"+ IntegerToString(i),
OBJ_TEXT,
0,
time[i],
high[i]+StepPer()*Point);
//--- установим привязку к правому верхнему углу
ObjectSetInteger(ChartID(),"candlesize"+IntegerToString(i),OBJPROP_ANCHOR,ANCHOR_UPPER);
ObjectSet ( "candlesize"+IntegerToString(i),
OBJPROP_ANGLE,
TextAngle
);
ObjectSetText ( "candlesize"+IntegerToString(i),
DoubleToStr(NormalizeDouble((high[i]-low[i]+Point)/Point, 0), 0),
TextSize,
NULL,
TextColor
);
}
return(rates_total);
}
int StepPer ()
{
int i = 0;
switch (Period())
{
case PERIOD_M1:
i = 5;
break;
case PERIOD_M5:
i = 15;
break;
case PERIOD_M15:
i = 25;
break;
case PERIOD_M30:
i = 40;
break;
case PERIOD_H1:
i = 60;
break;
case PERIOD_H4:
i = 90;
break;
case PERIOD_D1:
i = 220;
break;
case PERIOD_W1:
i = 500;
break;
case PERIOD_MN1:
i = 2000;
break;
default:
break;
}
return (i);
}
#property indicator_chart_window
input int TextSize = 8; //размер шрифта
input color TextColor = clrYellow; //цвет текста
input int TextAngle = 90; //угол поворота текста
input int MaxBar = 100; //количество баров, начиная с 0, для которых вычисляется размер свечей
int OnInit()
{
return(INIT_SUCCEEDED);
}
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
{
int i;
for ( i = 0; i < MaxBar; i++ ) {
if ( ObjectFind ("candlesize"+ IntegerToString(i)) >=0 ) {
ObjectDelete("candlesize"+ IntegerToString(i));
}
ObjectCreate ("candlesize"+ IntegerToString(i),
OBJ_TEXT,
0,
time[i],
high[i]+StepPer()*Point);
//--- установим привязку к правому верхнему углу
ObjectSetInteger(ChartID(),"candlesize"+IntegerToString(i),OBJPROP_ANCHOR,ANCHOR_UPPER);
ObjectSet ( "candlesize"+IntegerToString(i),
OBJPROP_ANGLE,
TextAngle
);
ObjectSetText ( "candlesize"+IntegerToString(i),
DoubleToStr(NormalizeDouble((high[i]-low[i]+Point)/Point, 0), 0),
TextSize,
NULL,
TextColor
);
}
return(rates_total);
}
int StepPer ()
{
int i = 0;
switch (Period())
{
case PERIOD_M1:
i = 5;
break;
case PERIOD_M5:
i = 15;
break;
case PERIOD_M15:
i = 25;
break;
case PERIOD_M30:
i = 40;
break;
case PERIOD_H1:
i = 60;
break;
case PERIOD_H4:
i = 90;
break;
case PERIOD_D1:
i = 220;
break;
case PERIOD_W1:
i = 500;
break;
case PERIOD_MN1:
i = 2000;
break;
default:
break;
}
return (i);
}
Bem, depois de virar, o ponto não está mais no centro superior, mas no centro esquerdo, então o texto é deslocado para a direita.
Bem, depois de virar, o ponto não está mais no centro superior, mas no centro esquerdo, então o texto é deslocado para a direita.
Muito obrigado !!!!!
Tudo funcionou da maneira que eu queria!
Mais uma vez, peço desculpas pelo mal-entendido e pela minha dureza!
Sem detalhes não é prova )))) Mostrar o texto completo do init e a declaração das variáveis.
Do final, atravessar e sair do laço a tempo. O que 10 pares têm a ver com isso? Mesmo uma centena, você tem ali uma seleção de caráter por característica.
}//+---------------------------------------------------------------------------------------+for
Ok, o mesmo laço aqui, por que fecha os pedidos?)