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

 
ALEKSANDR SOKOLOV #:

But if the indicator is switched on in the graph, there is no error

Without the source code it's hard to tell

 
Artyom Trishkin #:

Without the source code, it's hard to tell.


This is what the indicator and objects look like. Some of them can be disabled in inbox, but not all of them, and that's how these errors go too.

I have the source code (old and in need of improvement) and I can edit it to get rid of these problems. The question is to solve it without editing,

 
Roman Shiredchenko #:

"And check the logs in the shared and µl folder" - where in the shared folder?


... ...until the right ones are downloaded.

That's understandable. I will wait for the history data to be updated.

Thanks. I will have a look. Is the histories folder also in data folder in MQL5 folder?

I will look and delete...

I can see the old data directory:

The general metaquotes folder is the terminal folder, it contains the general terminal folders, there the terminal logs, data and the tester folder, it has its own logs and file folders. The mcl folder contains logs of EAs, scripts, indicators, windows, subwindows.
 
DanilaMactep #:

How do I write this condition correctly in the indirector and at the end of this function?

Functions to appear a new bar, if iTime != OldTime then Alert and OldTime =iTime on zero shift/bar.
 
Artem hello! Can you tell me if it is possible to download all your articles as a single archive?
 
Aleksandr Kononov #:
Artem Hello! Can you tell me if it's possible to download all your articles in one archive?

Hello. I don't. Why put them in the same archive if the development is incomplete? I don't see the point.

 
Valeriy Yastremskiy #:
New bar appears if iTime != OldTime then Alert and OldTime =iTime on zero shift/bar.

what value should be written in OldTime? O_o

The arrow itself is drawn at the moment the zero bar opens.

I made this condition.

 if(iTime(NULL,0,0)!=iTime(NULL,0,1))
      {
      Alert("ДИВЕРГЕНЦИЯ НА "+Symbol());
      }

It doesn't work properly - even in the tester, there are a lot of alerts in the log.

if(iTime(NULL,0,1)!=iTime(NULL,0,0))
      {
      Alert("ДИВЕРГЕНЦИЯ НА "+Symbol());
      }

i also get a bunch of alerts - i don't know how to write this thing(((

 
DanilaMactep #:

what value should be written in OldTime? O_o

The arrow itself is drawn at the moment the zero bar opens.

I made this condition.

It doesn't work properly - even in the tester, there are a lot of alerts in the log.

I also get a bunch of alerts - I don't understand how to write this thing (((

 
static datetime OldTime=0;
if(iTime(NULL,0,0)!=OldTime)
      {
      Alert("ДИВЕРГЕНЦИЯ НА "+Symbol()); OldTime=iTime(NULL,0,0);
      }

So, when you boot up, you will also get an alert. When a new bar appearsiTime(NULL,0,0) will be changed and there will be no equality once, then there will be equality and the if will be false.

You can also do it this way.

static bool FlagNewBar=false;
   if(BarTime!=Time[0])
     {
      BarTime=Time[0];
      FlagNewBar=true;
     }

Or we could get a new bar on any timeframe.

bool FlagNewBarF(int prd, datetime &ArgBarTime,bool &FlagNbar)
  {
   FlagNbar=false;
   if(ArgBarTime!=iTime(NULL,prd,0))
     {
      ArgBarTime=iTime(NULL,prd,0);
      FlagNbar=true;
     }

   return(FlagNbar);
  }

The call would be as follows

 if(FlagNewBarF(1, BarTime1,FlagNewBar1))
     {
      Alert("FlagNbar1 ",FlagNewBar1,"BarTime1 ",TimeToStr(BarTime1,TIME_DATE|TIME_SECONDS));
      
     }

   if(FlagNewBarF(5, BarTime5,FlagNewBar5))
     {
      Alert("FlagNbar5 ",FlagNewBar5,"BarTime5 ",TimeToStr(BarTime5,TIME_DATE|TIME_SECONDS));
     
     }
 
Valeriy Yastremskiy #:

This way there will also be an alert when loading. When a new bar appearsiTime(NULL,0,0) will be changed and there will be no equality once, then there will be equality and the if will be false.

Thank you very much for your help - I screwed it on - 1 alert came up on compilation - let's see what happens next :-)
 

"New bar" is evil, at this event you can get data from the "last bar" indicator i.e. newbar-1.

If you run 3 terminals on one server and, depending on trading frequency the signal skips in some terminals, i.e. before sending the order set print (Buy signal for example), and the indicator print value will show the value of the previous bar.

Of course, you can perform some checks...