Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 988

 
-nan(ind) is there no value?
 
Yevhenii Levchenko:
-nan(ind) is not a number?

not a number

 
Yevhenii Levchenko:

sizeof() returns the size of the variable type


That's right. An array is a collection of data of the same type. If you write it like this

int masiv[1];
Print(sizeof(masiv));//вернёт 4, потому что int 4 байта, если так masiv[2]- будет 8.
int Perem;
Print(sizeof(Perem));//вернёт 4, потому что int 4 байта
//если записать вот так
int masiv[];
Print(sizeof(masiv));вернёт 52 вне зависимости где и как объявлен массив.
//если записать вот так
int masiv[][3][3];
Print(sizeof(masiv));вернёт 52.


If you pass any of these arrays into a function, there will be a 52 question why.

 
Is there any script for mt5 to delete all the remaining arrow graphics after trades open, otherwise it's a long time to manually delete objects one by one.
 
Konstantin Lebedev:
Is there any script for mt5 to delete all the remaining graphical displays in the form of arrows after opening trades, because it takes a long time to manually delete objects one by one.

You don't need to do it one by one, you can delete all graphical objects at once in one go:


 
Konstantin Lebedev:
Is there any script for mt5 to delete all remaining graphical displays in the form of arrows after opening trades, otherwise it is long to delete objects manually one by one.

Drummer doesn't understand what the question is about. In the "History" or "Trade" tab, context menu and delete all at once. You can also disable adding.


 
Hello. Still (slowly, what's the rush?) mastering MT5. Faced with not understanding the record. Hint or if there is an indicator with a buffer line by time please send me the link))) Thanks
for(int i=limit; i>=0; i--)
{
...

MqlDataTime tm;
TimeToStruct(time[i],tm);

if(tm.hour==18 && tm.min==30 && Period()<=PERIOD_H1)
 {
//функция для создания таймлинии (вертикальная) ВСЕ ОК!

//КАК ВЫГЛЯДИТ ЗАПИСЬ СОЗДАНИЯ БУФЕРНОЙ ЛИНИИ ? ТАК НЕ ПОЛУЧАТСЯ 
for(int j=shift; j>=0; j--)
 {
CL=iClose(NULL,_Period,j);
Buff[i]=close[j]; // =CL;

if(Buff[j-1]!=Buff[j])
Buff[j-1]=EMPTY_VALUE;
 }
}

Doing
 

Help please


//+------------------------------------------------------------------+

//| Lex_Bands.mq4 |
//| Lex |
//| |
//+------------------------------------------------------------------+
#property copyright "Lex"
#property strict
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_plots 3
//--- plot Middle_Line
#property indicator_label1 "Middle_Line"
#property indicator_type1 DRAW_LINE
#property indicator_color1 clrLightSeaGreen
#property indicator_style1 STYLE_SOLID
#property indicator_width1 2
//--- plot Up_Line
#property indicator_label2 "Up_Line"
#property indicator_type2 DRAW_LINE
#property indicator_color2 clrLightSeaGreen
#property indicator_style2 STYLE_SOLID
#property indicator_width2 2
//--- plot_Line
#property indicator_label3 "Down_Line"
#property indicator_type3 DRAW_LINE
#property indicator_color3 clrLightSeaGreen
#property indicator_style3 STYLE_SOLID
#property indicator_width3 2
//--- indicator parameters
input int InpBandsPeriod=20; // MA Period
input int OtklPeriod=20; // Otkloneniya Period
input int OtklShag=5; // Shag Otkloneniya
input int MA_Type=0; // MA Type 0 - SMA, 1 - EMA, 2 - SMMA, 3 - LWMA
input int Applied_Price=4; // 0 - PRICE_CLOSE, 1 - PRICE_OPEN, 2 - PRICE_HIGH, 3 - PRICE_LOW, 4 - PRICE_MEDIAN, 5 - PRICE_TYPICAL, 6 - PRICE_WEIGHTED

//--- indicator buffers
double_LineBuffer[];
double_LineBuffer[];
double_LineBuffer[]; double Down_LineBuffer[];

//+------------------------------------------------------------------+
//| Custom indicator initialisation function|
//+------------------------------------------------------------------+
int OnInit()
{
IndicatorBuffers(7);
SetIndexBuffer(0,Middle_LineBuffer);
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(1,Up_LineBuffer);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(2,Down_LineBuffer);
SetIndexStyle(2,DRAW_LINE);
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars = IndicatorCounted();
if(counted_bars < 0) return(-1);
if(counted_bars > 0) counted_bars;
int limit = Bars - counted_bars;
if(counted_bars==0) limit--;
double dOtklSumMax[];
double SrOtklMax[];
double dOtklSumMin[];
double SrOtklMin[];
for(int i=1;i<=limit;i++)
{
for(int j=i;j<=i+OtklPeriod;j=j+OtklShag)
{
double max=High[iHighest(NULL,0,MODE_HIGH,OtklShag,j)];
double min=Low[iLowest(NULL,0,MODE_HIGH,OtklShag,j)];
double Otklmax=max-iMA(NULL,0,InpBandsPeriod,0,MA_Type,Applied_Price,j);
double Otklmin=iMA(NULL,0,InpBandsPeriod,0,MA_Type,Applied_Price,j)-min;
doubleOtklmax=Otklmax*Otklmax;
dOtklSumMax[j]=dOtklSumMax[j-1]+dOtklSumMax[j];
dOtklSumMax[OtklShag]=dOtklSumMax[j];
double dOtklmin=Otklmax*Otklmax;
dOtklSumMin[j]=dOtklSumMin[j-1]+dOtklSumMin[j];
dOtklSumMin[OtklShag]=dOtklSumMin[j];
}
Middle_LineBuffer[i]=iMA(NULL,0,InpBandsPeriod,0,MA_Type,Applied_Price,i);
SrOtklMax[i]=MathSqrt(dOtklSumMax[OtklShag]/(OtklPeriod/OtklShag));
SrOtklMin[i]=MathSqrt(dOtklSumMin[OtklShag]/(OtklPeriod/OtklShag));
Up_LineBuffer[i]=iMA(NULL,0,InpBandsPeriod,0,MA_Type,Applied_Price,i)+SrOtklMax[i];
Down_LineBuffer[i]=iMA(NULL,0,InpBandsPeriod,0,MA_Type,Applied_Price,i)-SrOtklMin[i];
}
return(0);
}

Here is the indicator code. It has no errors when compiled, but it shows nothing on the chart.
 
Xander1603:

Please help.

...

Here is the code for the indicator. It doesn't give any errors when compiling, but it doesn't show anything on the chart at all.

Insert the code correctly:


And don't create many topics with a simple question.

 
How do you convert string to enum?
Reason: