
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello !
Help me fix the code so that the bar captions are in the centre of the bar above the high bar and not on the side
#property strictProof: Print("Previous job PriceAsk-",PriceAsk); the log is empty.
Without details it's not a proof )))) Show me the full text of the init and the declaration of variables.
Also, why check ALL orders, from the very beginning of the account life, if you need the latest? - How else to do it, if there are 10 currency pairs open?
You have to go through them from the end and exit the cycle in time. What has 10 pairs got to do with it? Even a hundred, you have a symbol to choose from.
Hello !
Help me to correct the code so that the inscriptions above the bars would be in the centre of the bar above the high bar and not on the side
Learn how to use SRC button to insert code.
And read about OBJPROP_ANCHOR.
Learn how to use the SRC button to insert code.
And read about OBJPROP_ANCHOR.
Got it !
Sorry for the abruptness !
Got it, thanks !
Sorry for the harshness !
#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);
}
Well, after turning, the dot is no longer at the top centre, but to the left centre, so the text is shifted to the right.
Well, after turning, the dot is no longer at the top centre, but to the left centre, so the text is shifted to the right.
Thank you so much !!!!!
It all worked out the way I wanted !
Once again, I apologize for misunderstanding and my harshness !
Without details it's not proof )))) Show the full text of the init and the declaration of variables.
From the end to go through and exit the loop in time. What do 10 pairs have to do with it? Even a hundred, you have a character-by-character selection there.
}//+---------------------------------------------------------------------------------------+for
Ok, same loop here, why does it close orders?)