Errors, bugs, questions - page 2728

 
Askr:

Thank you.

I found this other thing that maybe 1)is a blocking broker.

https://www.mql5.com/ru/forum/38456/page127

https://www.mql5.com/ru/forum/304679

2) I've seen 110% and 70% jumping constantly and strongly, I haven't counted it yet. Maybe it has something to do with load, but I don't think so. I opened small things and the leverage in the specs is the same and the balances are almost the same.

A common thread about signals is this one
https://www.mql5.com/ru/forum/10603/page394
For information.

FAQ по сервису Сигналы
FAQ по сервису Сигналы
  • 2020.04.18
  • www.mql5.com
Узнать за 15 минут: смотри обучающие видео по торговым сигналам в MetaTrader 4 и MetaTrader 5 Здесь будут собраны и обработаны наиболее частые вопр...
 
Sergey Dzyublik:

Bug MT5 (build 2390) incorrectly counts curly braces in class structure description.

Thanks for the post, fixed

 

that's how it works:

   ObjectSetDouble (0,name,OBJPROP_ANGLE,direction==0?0:direction>0?30:-30);

so no (always 0)

   ObjectSetDouble (0,name,OBJPROP_ANGLE,direction*30);

direction -1; +1; 0

 
Igor Zakharov:

that's how it works:

so no (always 0)

direction -1; +1; 0

And so

ObjectSetDouble (0,name,OBJPROP_ANGLE,( direction==0?0:direction>0?30:-30));
 
Alexey Viktorov:

And this way.

also works, the second option doesn't work

 
   ObjectSetDouble (0,name,OBJPROP_ANGLE,direction*30.0);
direction you have declared as int. That's what you get. Lately, many functions have become rather finicky about values. It's better to secure with a conversion.
I myself have faced such problems recently. I had no problems before. But I was asked to correct the code and it did not want to work properly until I cast it to double.
 
Konstantin Nikitin:
You have the direction declared as int. That's what you get. Lately, many functions have become rather finicky about values. It's better to take care of the conversion.
I myself have faced such problems recently. I had no problems before. But I was asked to correct the code and it didn't want to work properly until I brought it to double.

Yes, int. But it's multiplication - in integers it's also 30*1=30. I'm 100% sure that a few builds ago it worked fine in the second variant as well, as these 30 were determined by picking...

looks like another "feature" of MT5... At least the block is decorative, but if somewhere like autolot or stoploss - sadness may happen - I often reverse by multiplying by -1...

Thanks, I'll use another crutch...

 
Igor Zakharov:

also works, the second option doesn't work.

Ah. I inadvertently copied the wrong code.

Konstantin is right, why put int where double is expected... This is not a feature of mql5, it's just some attempts to get used to order.

 

Please help.

The indicator is throwing out with an array out of the range error.

In the code I have defined the buffers

#property indicator_buffers 2

#property indicator_color1 Red

#property indicator_width1 1

#property indicator_plots  1 // количество графических построений

#property indicator_type1   DRAW_ARROW


Declared global variables

double Buf1[];

double Buf2[];

In Init() I have defined the properties

    PlotIndexSetInteger(0,PLOT_ARROW,code); 

//--- установим пустое значение 

   PlotIndexSetDouble(0,PLOT_EMPTY_VALUE,0);

   SetIndexBuffer(0,Buf1,INDICATOR_DATA);

   PlotIndexSetString(0, PLOT_LABEL, "Break");



//----

   PlotIndexSetInteger(1,PLOT_ARROW,code);  

//--- установим пустое значение 

   PlotIndexSetDouble(1,PLOT_EMPTY_VALUE,0);

   SetIndexBuffer(1,Buf2,INDICATOR_CALCULATIONS);

   PlotIndexSetString(1, PLOT_LABEL, "Break");


In OnCalculate(), the code defines a condition - the up variable.

If it is true, then the following code is executed

  i=nPoint1; BreakUp=false; BreakDn=false;
  
while(i>=0 && BreakUp==false && BreakDn==false)
  {              Print("i  ",i);                 tmp=iHigh(NULL,0,nPoint1)-Speed*(nPoint1-i);        tmp1=iHigh(NULL,0,nPoint1)-Speed*(nPoint1-i)-resultL;        if(NormalizeDouble(iLow(NULL,0,i),Digits())<NormalizeDouble(tmp1,Digits()) && NormalizeDouble(iHigh(NULL,0,i),Digits())>NormalizeDouble(tmp,Digits()))         {          size=ArraySize(Buf1);          Print("size ",size);                   BreakUp=true;          if(channelbreak) Buf1[i]=tmp;          Comm="\nПробой вверх на уровне " + DoubleToString(tmp,Digits());         }        else        if(NormalizeDouble(iLow(NULL,0,i),Digits())<NormalizeDouble(tmp1,Digits()))         {          size=ArraySize(Buf1);          Print("size ",size);                          BreakDn=true;          if(channelbreak) Buf1[i]=tmp1;          Comm="\nПробой вниз на уровне "+DoubleToString(tmp1,Digits());         }        else        if(NormalizeDouble(iHigh(NULL,0,i),Digits())>NormalizeDouble(tmp,Digits()))         {          size=ArraySize(Buf1);          Print("size ",size);                   BreakUp=true;          if(channelbreak) Buf1[i]=tmp;          Comm="\nПробой вверх на уровне "+DoubleToString(tmp,Digits());         }        else Comm="\nПробоя канала нет";        //i--;       }     } Ошибка происходит при входе в цикл while при присвоении значения переменной значению буфера. Проверка на размер массива буфера выдает ноль. Т.е. буфер не инициализируется. Всю голову сломал, не могу понять почему. В чем затык?
nPoint1 - это индекс бара (сдвиг от нулевого).
 
Ilyas:

Please clarify whether it is normal that during the indicator's debugging, the values of this indicator are not visible on the opened chart? I.e., for example, we open MACD in the debugger. We set a breakpoint in the cycle of writing values into the buffers. After value writing ChartRedraw(). I expect to see this value on the chart at once after the value is written but I only see an empty window.

Build 2380 x64.