Questions from Beginners MQL5 MT5 MetaTrader 5 - page 275

 
jommerbot:
Then why is it like that on one machine and different on the other? I transferred sources to %programfiles%\LiteForex MT5\MQL5, I start editor - they are not there (I need to copy them to %appdata%\MetaQuotes\Terminal\0DF37F59A46B215DB2AE3D3D96D0F055\MQL5), but in Windows 7, if sources are placed in %programfiles%\MetaTrader 5\MQL5\ then everything is found and compiled.

The terminal on "7" may have been installed with a Portable key:

Forum on trading, automated trading systems and trading strategy testing

Data Folder location

sergeev, 2010.01.23 13:21

Renat Thank you very much!!!!

I have added /portable to metaeditor.exe shortcut and it has worked. The Data Folder link has now automatically moved to the terminal install folder.

(By the way - I put terminals in Program Files)

Also write in terminal.exe /portable - it's necessary to take data from installation path. And for F4 to open editor in required park too.

I had to explore settings of file type mapping and add /portable to the ".mq5" opening line too.

Now everything works as it should.


 
barabashkakvn:

Maybe the terminal on "7" was installed with a Portable key:

No, I remember exactly that I downloaded and installed from official sourcehttps://www.metatrader5.com/ru/download without any keys, just in case I checked startup shortcuts - no specified keys either... miracles. I now understand how to do it on server 2003 - I just put the key on shortcuts. Thanks.

And by the way, the bilds are the same:

Скачать MetaTrader 5
Скачать MetaTrader 5
  • www.metatrader5.com
Скачать торговый терминал MetaTrader 5 для комфортной и успешной работы на финансовых рынках. Терминал обладает внушительными торговыми и аналитическими возможностями и является одним из лучших в мире
 
jommerbot:
It's just that for me, git is more familiar and convenient than subversion.
There shouldn't be any problems with git. Personally, it works great with mql files for me.
 

And here's another question: why FileIsExist, if the file doesn't exist, then the error 5019 (file doesn't exist) appears, in my opinion it's somehow not logical. I have a tight control in EA initialization:

   if( GetLastError() != ERR_SUCCESS ) {
      return(INIT_FAILED);
   }
I don't want to make separate crutch exceptions for specific errors, maybe there is some other way to check if the file exists?
 
jommerbot:

And here's another question: why FileIsExist, if the file doesn't exist, then the error 5019 (file doesn't exist) appears, in my opinion it's somehow not logical. I have a tight control in EA initialisation:

I wouldn't want to make separate crusty exceptions for specific errors, maybe there is some other way to check if the file exists?
Do you have ResetLastError() before reading the error?
 
paladin800:
Do you haveResetLastError() before reading the error ?
So no - that's the point, if there was an error somewhere in the code during initialisation, it would be dangerous to reset it, or am I wrong?
 
jommerbot:
So no - that's the point, if an error occurred somewhere in the code during initialization, it would be dangerous to zero it, or am I wrong?
ResetLastError() must be put before call of operation after which error should be read. In the FileOpen example (there, in second part) ResetLastError is before filehandle. Please do the same.
 
jommerbot:
So no - that's the point, if there was an error somewhere in the code during initialisation, it would be dangerous to zero it, or am I wrong?
It's more dangerous not to know about it. Print it, then reset it before a new call.
 
But before theFileIsExist section, there is more than one place with a potential error. But everything is logged anyway. I did not know about this function. But this does not solve the problem - the error doesn't occur before calling FileIsExist, it occurs when calling FileIsExist. Anyway, I have done it in a different way, via search. Thanks for the answers.
 
aleks557:

hello beginner and advanced help solve grade 5 maths problem:)

...

I need to find the arithmetic mean of the offered currencies. how easy would it be to write such an indicator ? .......p.s so far this idea is not intended for any trading purposes but purely educational in nature
To make your message easier to read, please read: Insert code correctly in the forum
Reason: