Questions from a "dummy" - page 84

 
Expert:
...
Andrei, it's crazy, you're going to make a manual trading tester and you can't fix the indicator, go and search for missing data in the counters.
 
Urain:
I`m crazy about you, you`re going to build a manual trading tester and you can`t fix the indicator, you have to search for the missing data in the counters.

You have me confused with Andrei again=)

The data does not disappear, but rather the data does not disappear.

It's not easy to dig and debug because the indicator redraws points a few bars back.

 
Expert:

You have me confused with Andrei again=)

The data does not disappear, but rather the data does not disappear.

And it's not easy to dig and debug because the indicator redraws points a few bars back.

Yes, sorry, I got confused.

Note the direction of indexing of arrays, not to confuse you with prints.
Документация по MQL5: Основы языка / Переменные
Документация по MQL5: Основы языка / Переменные
  • www.mql5.com
Основы языка / Переменные - Документация по MQL5
 
Urain:

Yes, I'm sorry, I got confused.

Pay attention to the direction of array indexing, so that you don't get confused, check it yourself with prints.

Okay, I will.

But the main question is why these patterns disappear when I switch the TF.

Sometimes these patterns coincide with the arrays on which the indicator is built, and sometimes they are chaotically scattered in the graph.

Zeroing the array elements in the right places seems to happen...

 
Expert:

OK, I will.

But the main question is why do these patterns disappear when I switch thef.

These patterns sometimes coincide with the arrays on which the indicator is built, sometimes they are chaotically scattered across the graph.

Zeroing of array elements in proper places seems to happen...

When TF is switched, reinitialization happens, that's why the patterns disappear.

Aren't you building a pattern with graph objects? If so, they need to be managed when they need to be deleted.

ZS In general, without code (one picture) is difficult to even understand what is wrong, let alone find the cause.

 
Urain:

When the TF is switched, it is re-initialised, so the patterns disappear.

Aren't you building a pattern with graph objects? If so, they need to be controlled when they need to be deleted.

HH in general without code (one picture) is difficult to even understand what is wrong, let alone find the cause.

#property indicator_type1 DRAW_ARROW

#property indicator_type2 DRAW_ARROW

#property indicator_type3 DRAW_ARROW

Not graph objects, buffers.

But code, yes please)

Files:
WATL.mq4  24 kb
WATL.mq5  41 kb
 
Expert:

#property indicator_type1 DRAW_ARROW

#property indicator_type2 DRAW_ARROW

#property indicator_type3 DRAW_ARROW

Not graph objects, buffers.

But code, yes please)

First of all it's a decompiled code, and second, there are a lot of bugs in the migration process.

Take this pearl for example

iBarShift(NULL,0,ai_4,false);

And this despite the fact that the CopyTime function does not have such a concept as a null character

(NULL) passed to the string type parameter will pass ""

int iBarShift(string symbol,
              int tf,
              datetime time,
              bool exact=false)
  {
   if(time<0) return(-1);
   ENUM_TIMEFRAMES timeframe=TFMigrate(tf);
   datetime Arr[],time1;
   CopyTime(symbol,timeframe,0,1,Arr);
   time1=Arr[0];
   if(CopyTime(symbol,timeframe,time,time1,Arr)>0)
     {
      if(ArraySize(Arr)>2) return(ArraySize(Arr)-1);
      if(time<time1) return(1);
      else return(0);
     }
   else return(-1);
  }


contact your developer

Документация по MQL5: Доступ к таймсериям и индикаторам / CopyTime
Документация по MQL5: Доступ к таймсериям и индикаторам / CopyTime
  • www.mql5.com
Доступ к таймсериям и индикаторам / CopyTime - Документация по MQL5
 
Urain:

First of all, it's a decompile, and secondly, there are a lot of bugs in the migration.

Just look at this perl

And this despite the fact that the CopyTime function has no such thing as a null character

(NULL) passed to the string type parameter will pass ""


contact the developer

I don't want to $$talk to a developer =)

In any case, thanks for the wise advice.

 
Expert:

No $wish$ to contact the developer =)

In any case, thanks for the good advice.

But it's not all there, in idea pass graph object instead of chart id 0, you can, but in practice it's better to give the chart number.

In general, there is a lot to understand

it's not clear what the programmer wanted to say with this code:

int Double2Int(double ad_0) 
  {
   return(int(StringToInteger(DoubleToString(ad_0,0))));
  }

It's easier and faster for me:

(int)NormalizeDouble(ad_0,0)

rather than rounding via thongs

 
Urain:

But there's more to it, in theory it's possible to pass 0 instead of the chart id when creating a graph object, but in practice it's better to give the chart number.

In general, there is a lot to sort out

it's not clear what the programmer wanted to say with this code:

I think it's easier and faster:

Than to do rounding via strings

the objects here are lines, I've truncated them, so that's obviously not where the error lies.

The rounding through the string is due to the fact that MQL4 has no method like (int), while in rewriting I left it as is deliberately to maximize the codes coincidence.

But apparently, you can still replace the old version with yours.