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

 
Alexey Viktorov:
Artyom Trishkin:
   PlotIndexSetInteger(0,PLOT_DRAW_TYPE,DRAW_LINE);

Thanks, TimeDayOfWeek() in mql5?

How to do this?
if(targetPeriod==PERIOD_D1)
     {
      if(TimeDayOfWeek(result.StartTime)==SUNDAY && ignoreSunday)
         result.StartTime-=86400;

      if(TimeDayOfWeek(result.EndTime)==SATURDAY && ignoreSaturday)
         result.EndTime+=86400;
     }
 
bij:

Thanks, TimeDayOfWeek() in mql5?

How do I do this?
MqlDateTime timestruct={0};

::TimeToStruct(result.EndTime,timestruct);

if(timestruct.day_of_week==SATURDAY && ignoreSaturday)
         result.EndTime+=86400;
 
Artyom Trishkin:
PlotIndexSetInteger()
Why are you picking on me? It's one letter wrong... )))))))))))))))))
 
Andrey Barinov:

I would also replace 86400 with

PeriodSeconds(PERIOD_D1);
 
does the MT4 tester take commission into account?
 
Andrey Barinov:

Thank you, what about TimeHour()?

if(TimeHour(preciseNextPeriodStartTime)==0)

It doesn't feel like it.

 ::TimeToStruct(preciseNextPeriodStartTime,timestruct);

 if(timestruct.preciseNextPeriodStartTime==0)
 
bij:

Thank you, what about TimeHour()?

It doesn't feel like it.

https://www.mql5.com/ru/docs/constants/structures/mqldatetime
 
Ihor Herasko:

Take only M1 data. Delete all other TFs(close charts and delete history files from the history folder when the terminal is off). Create all other TFs on the basis of M1 using the regular period_converter script.

With the terminal closed I deleted files for one symbol from the folder history/*broker's name*-demo/.

Started the terminal and entered quote archive. Loaded M1, but data for last 4 trading days only came. Why not to get all data for all time period, so to say, weathering?) The main problem is that data for longer periods of time is not downloaded yet. Thus, there is simply nothing much to calculate for older timeframes. But the data are supposed to be available somewhere since 1999. Can it be related to the fact that I am still in a demo account?

 
danminin:
does the MT4 tester take commission into account?

no

 
Sergii Krutyi:

no

Why not? If the MT4 is connected to an account with a commission during testing, it will definitely take it into account.