Questions from Beginners MQL5 MT5 MetaTrader 5 - page 911

 

Good afternoon, forum users.

This question has arisen and therefore I am asking for help.

The Expert Advisor needs to calculate every day at 00:00 hours, how many symbols have passed since the previous 00:00. I.e. how do I find out how many symbols have passed in 24 hours?

 
ISL:

Good afternoon, forum users.

This question has arisen and therefore I am asking for help.

The Expert Advisor needs to calculate every day at 00:00 hours, how many symbols have passed since the previous 00:00. I.e. how to find out how many symbols have passed in 24 hours?

double open = iOpen(NULL,PERIOD_D1,0); 
double close = iClose(NULL,PERIOD_D1,0); 
Print( open - close);
 
Николай Гаврилов:
How long before I can start trading. An account has been created and money has been deposited. But everything is blocked and does not show the balance. It has been almost a day. I have not done anything wrong?

Call the broker.

 
Vitaly Muzichenko:

Got it)Thank you very much!

And another question, so as not to calculate this case on every tick, only enter if it's 00:00?

if (TimeCurrent()).......
 
ISL:

Got it)Thank you very much!

And another question, in order not to calculate this case on every tick, enter only if it's 00:00?

I would do the "New Bar" event, search the forum - there are plenty of examples

 
ISL:

Got it)Thank you very much!

And another question, so as not to calculate this case on every tick, enter only if it's 00:00?

If you don't need a new bar for other purposes, you can do with a variable.

int Date_Last_Bar=0;   // дата последнего часового бара
MqlDateTime stime;

void Time_00(int day)
  {
   Date_Last_Bar=day;
   double open=iOpen(NULL,PERIOD_D1,0);
   double close=iClose(NULL,PERIOD_D1,0);
   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);
         // здесь процедура первой инициализации, если нужно
        }
      else
        {
         Time_00(stime.day);
        }
     }
  }
 
Sergey Savinkin:

If you don't need a new bar for other purposes, you can get by with a variable.

Helpful)Thank you!

 

Good afternoon!

I have a misunderstanding about the following.

I have a deposit of $5,000. I am creating a portfolio.Its value is $4985.1204.Next, I want to understand how much free money I have left on which I can trade without using the leverage.

5000-4985,1204=14,8796- that's it!

Now I'm counting them manually, I always keep the position volumes in my memory and I always count them manually when there is a spill.

Is it possible to access them without such constant monitoring?

     svoltake3=balance-svolzak;                                 //Здесь я считаю в ручную и все правильно
     free_margin_=AccountInfoDouble(ACCOUNT_FREEMARGIN);        //не то значение
        balance_=AccountInfoDouble(ACCOUNT_BALANCE);            //не то значение
      equity_=AccountInfoDouble(ACCOUNT_EQUITY);                //не то значение
      stopout_level_=AccountInfoDouble(ACCOUNT_MARGIN_SO_SO);   //не то значение


There is no such possibility? Do you have to monitor them yourself?

 
I can't get a video from YouTube to the forum. I select the video, insert the link. And in place of the video I see an empty white field. My browser is Google Chrome. Can you tell me why this may be?
 
Sergey Savinkin:
I can't get video from youtube to the forum. I choose a video, insert a link. And in place of the video I see an empty white field. My browser is Google Chrome. Can you tell me what it may be?

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.

If you want an exact answer, don't be too lazy to write the exact question.

Insertion test: