Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1458

 
vitaliy zamkovoy ObjectMove(0, "LineAB", prevTime, prevPrice, newAx, newAy); it says wrong parameters count. Where is the error?

https://www.mql5.com/ru/docs/objects/objectmove

 
Can you tell me how to install a robot on MT which is on a VPS? Before that it was activated in MT5 on the computer.
 
Arkin Nabirov on a VPS? Before that it was activated in MT5 on the computer.
disconnect it from the VPS, activate it on your terminal and put it on the chart
 
Can you tell me how to find out the date of the first trading day in January of any year using MQL4.5?
 
elzinkhana #:
How can I find out the number of the first trading day in January of any year using MQL4.5?

You can't. You can only collect such data yourself.

 
elzinkhana #:
How can I find out the number of the first trading day in January of any year using MQL4.5?
/********************Script program start function*******************/
void OnStart()
 {
  datetime newYear[];
  int bars = Bars(_Symbol, PERIOD_D1, D'2020.01.01', TimeCurrent())-1;
  CopyTime(_Symbol, PERIOD_D1, bars, 1, newYear);
  printf("Первый торговый день %s %s", EnumToString(ENUM_DAY_OF_WEEK((newYear[0]/PeriodSeconds(PERIOD_D1)+4)%7)), TimeToString(newYear[0]));
 }/******************************************************************/

Result

2023.05.14 13:37:02.118 !!0 (EURUSD,D1) Первый торговый день MONDAY 2022.01.03 00:00
2023.05.14 13:38:18.547 !!0 (EURUSD,D1) Первый торговый день MONDAY 2021.01.04 00:00
2023.05.14 13:38:35.906 !!0 (EURUSD,D1) Первый торговый день THURSDAY 2020.01.02 00:00
 
Alexey Viktorov #:

Result

Why decide it was a trading day? Is the idea in the presence of quotes? And if there were quotes but you couldn't trade - I think that's the question.

 
Aleksey Vyazmikin #:

What made the decision that it was a trading day? Is the idea that there were quotes available? And if there were quotes but you couldn't trade - I think that's the question.

Open MT and take a look. Why ask such questions without looking? The bar is there with all the attributes of OHLC. Everything else is just your imagination.....

 

I noticed that trading days start in January in one of three variants: 2 January or 3 January or 4 January.
And I was even able to write a subroutine in MQL4 to determine the date of the first trading day in the new year.

int inp_Year=2016; //put the number of the year of interest into the variable
datetimefirst_day_New_Year=StringToTime(IntegerToString(inp_Year)+".01.02 00:00"); //variable where we will record the exact date of the beginning of the trading year, if the trading of a certain year started on the 2nd of January, if the 2nd of January was a weekday
if (TimeDayOfWeek(first_day_New_Year)==0) first_day_New_Year=StringToTime(StringSubstr(TimeToString(first_day_New_Year),0,4)+".01.03 00:00"); //3 January started trading of a certain year, if 2 January was Sunday
if (TimeDayOfWeek(first_day_New_Year)==6) first_day_New_Year=StringToTime(StringSubstr(TimeToString(first_day_New_Year),0,4)+"".01.04 00:00"); //4 January trades of a certain year started, if 2 January was Saturday
Comment("first trading day in ", inp_Year, " year= ",first_day_New_Year);

 
Alexey Viktorov #:

Open the MT and take a look. Why ask such questions without looking? The bar is there with all the attributes of OHLC. Everything else is in your head.....

I just came across the fact that the quotes are there but trading is prohibited on futures contracts. That's why I thought it was the same situation.