Questions from Beginners MQL4 MT4 MetaTrader 4 - page 164

 

Happy New Year !!!

Could you please tell me how to attach a lock order to an EA?

 

Hello.

Can you please tell me how to determine the date (in date format) of the beginning of the week and the end of the week? I need the oscillator to zero out at the end of the week and start counting from zero at the beginning of the new week. At the moment I know how to set it to zero for each day, but I have no idea how to set it to zero for each week. This is how I reset every day.

void Calculate(int i)
  {
   double summ;
   datetime startTime  = StringToTime(TimeToString(Time[i],TIME_DATE)+" "+StartTime); // StartTime=00:10
   datetime endTime    = StringToTime(TimeToString(Time[i],TIME_DATE)+" "+EndTime);   // EndTime=23.50
   datetime currentTime= StringToTime(TimeToString(Time[i],TIME_DATE)+" "+TimeToString(Time[i],TIME_MINUTES));
//Print("Start = ",TimeToString(startTime,3));
//Print("End = ",TimeToString(endTime,3));
   if(CheckTimer(i,startTime,endTime,currentTime,0))
     {
      summ = MainBuffer[i+1];
      summ+= InfluenceBuffer[i];
      MainBuffer[i]=summ; 
     }
   else
     {
      summ=0.0;
      MainBuffer[i]=summ;
      }
  }

Thanks

 
Hi guys, can you tell me how to solve the problem? I have a portable version of the terminal on my computer and it's stored on drive D. Everything works and the working directory is also there. I have the same version on my laptop and it is installed the same way (works by running shortcut with prefix /portable). Found a manual trading helper and it's tied to running the economy calendar on java. And it gives an error citing that the terminal is portable. I've installed new default terminal on my laptop (working directory is in users/ AppData and so on) and it works. Wanted to do the same on PC and installed default terminal. But its working directory is installed in Program Files (x86) folder with the program for some reason. How can I get it to install in the same way as it was installed by default? I have installed version 1809 on both computers. Thanks in advance for the help!
 
Gerkl:

Hello.

Can you please tell me how to determine the date (in date format) of the beginning of the week and the end of the week? I need the oscillator to zero out at the end of the week and start counting from zero at the beginning of the new week. At the moment I know how to set it to zero for each day, but I have no idea how to set it to zero for each week. This is how I reset every day.

Thanks

Check the start day of the week, e.g. on Monday, at the first quote, reset
(TimeDayOfWeek)

 
Dmitry Pan:
Good day! Guys advise how to solve the problem? I have a portable version of the terminal on my computer and it is stored on the drive D. Everything works and the working directory is in the same place. I have the same version on my laptop and it is installed the same way (works by running shortcut with prefix /portable). Found a manual trading helper and it's tied to running the economy calendar on java. And it gives an error citing that the terminal is portable. I've installed new default terminal on my laptop (working directory is in users/ AppData and so on) and it works. Wanted to do the same on PC and installed default terminal. But its working directory is installed in Program Files (x86) folder with the program for some reason. How can I get it to install in the same way as it was installed by default? I have installed version 1809 on both computers. Thanks in advance for the help!

I also have a ten 1809. Now I tried to install mt4 to C drive, then to D drive - by default the working directory of the program is installed in AppData, as it should be. I have a feeling that your desktop installs well too. But what is it?

 
Alexandr Saprykin:

I also have a ten 1809. Now I tried to install mt4 to C drive, then to D drive - by default the working directory of the program is installed in AppData, as it should be. My idea is that my mt4 will not work properly when I install it on my desktop, I will try to install it on disk C and then disk D. The working directory of the programme is installed by default in AppData. But what is it? Isn't it...

Can it be connected with the Windows accounts? I mean the fact that when you download the platform from the broker website it is somehow tied to the account of the Windows. The laptop just has an account with no connection to Microsoft, but on the computer it is linked to Microsoft. Could this be the case?

 
Dmitry Pan:

Can it be connected with the Windows accounts? I mean, when I download the platform from the broker's website, it is somehow linked to the Windows account. My laptop just has an account with no connection to Microsoft, but on my computer it is linked to Microsoft. Can it be?

No. The terminal is not linked to the Microsoft account in any way. I also tried to install MT4 on my computer with my Microsoft account. The problem is something else. Is the account you use for installing the terminal on your computer an administrator?

 
Alexandr Saprykin:

No. The terminal is not linked to a Microsoft account in any way. I experimented with installing MT4 on a computer with a Microsoft account. It's something else. Is the account you use for installing the terminal on your computer an administrator?

Yes I am administrator on all the computers, but why is the directory installed differently?
 
Dmitry Pan:
Yes I am an administrator on all computers, but why does the directory install differently?
Who knows why.
Did you run the installation file as administrator?
 
Alexandr Saprykin:
Who knows why.
Did you run the installation file as administrator?
I can do it both from the command line and with the auto key, I don't understand why, it installs as a portable version for some reason ....
Reason: