Questions from Beginners MQL5 MT5 MetaTrader 5 - page 912

 
Vladimir Karputov:

In your post, the forum has already inserted a link on how to insert videos correctly. Since you haven't told us what you're doing and how you're doing it, we can only guess.

I am doing exactly that. It turns out that some videos from youtube are inserted normally and some are a white blur. There seems to be something wrong with the video itself, as this isn't the first time I've had this problem.

 
Sergey Savinkin:

That's exactly what I'm doing. It turns out that some youtube videos are inserted normally and some are white-blanked. There seems to be something wrong with the video itself, as this isn't the first time I've had this problem.

Somewhere, somehow ... Club of telepaths please.


Added:

Well at least give me an example of a video that isn't being inserted?

 
Vladimir Karputov:

At least give me an example of a video that isn't being inserted.

Here's the usual link.

https://www.youtube.com/watch?time_continue=5&v=bNxNrMK5T6Q

Here's a link in video format (via the toolbar button with the youtube icon)


 
Sergey Savinkin:

Here's the usual link.

https://www.youtube.com/watch?time_continue=5&v=bNxNrMK5T6Q

Here is the link in video format (via the toolbar button with the youtube icon)




You are definitely doing something different from the instructions.

 
Vladimir Karputov:

))))

That's my point exactly. Maybe the problem is with the browser. If anyone has encountered this problem, have a clue. )

 
Sergey Savinkin:

Here's the usual link.

https://www.youtube.com/watch?time_continue=5&v=bNxNrMK5T6Q

Here's the link in video format (via the toolbar button with the youtube icon)


The most straightforward instruction:How to embed video on the forum

 
Vladimir Karputov:

The best instruction ever:How to insert a video into the forum

I know how to insert videos, but not all videos are inserted.


 
ISL:

It helped)Thank you!

Now that I've looked at it... did it really help? )))

The function reads the opening / closing date of the current daily bar. But when the date changes, the bar changes. So the correct code should look like this:

int Date_Last_Bar=0;   // дата последнего часового бара
MqlDateTime stime;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
void Time_00(int day,int Param)
  {
   Date_Last_Bar=day;
   double open=iOpen(NULL,PERIOD_D1,Param);
   double close=iClose(NULL,PERIOD_D1,Param);
   Print(open-close);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int OnInit()
  {
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
void OnTick()
  {
   TimeToStruct(TimeCurrent(),stime);
   if(stime.day!=Date_Last_Bar)
     {
      if(Date_Last_Bar==0) // это первый запуск или перезапуск, надо учесть
        {
         Time_00(stime.day,0); // смотрим текущий бар, от сегодняшнего 00:00.
         // здесь процедура первой инициализации, если нужно
        }
      else
        {
         Time_00(stime.day,1); // бар сменился, когда робот уже работал, т.е. наступило 00:00,
         // и нужно считывать открытие / закрытие вчерашнего бара
        }
     }
  }
 
Sergey Savinkin:

Now that I've looked at it... did it really help? )))

The function reads the opening / closing date of the current daily bar. But when the date changes, the bar changes. So the correct code should look like this:

I did)

      open[i]=iOpen(Symbols[i],PERIOD_D1,1);
      close[i]=iClose(Symbols[i],PERIOD_D1,1);
      c_o[i]=(close[i]-open[i])/close[i];

Just did not fillint Param.

I did it immediately yesterday!

 

Hello

Please advise how to correctly replace the expression

trend[i] = (i<Bars-1) ? (price>amax[i+1]) ? 1 : (price<amin[i+1]) ? -1 : trend[i+1] : 0;

with operators (if and else)

thanks

Reason: