Same editor for different mt4 it's possible?

forextastic
49
Hi, I use MT4 on my internal hard drive and on two other external ones, and since it often gets confusing to switch files from one to the other, do you know if it is possible to use a single editor with multiple Mt4s?
Which then in reality, I think this is already possible, the most correct question is whether it is possible for two metatraders to share the same Expert folder.
Fernando Carreiro
10044

I too have multiple MetaTrader installations on my PC and on VPS and this is how I handle the situation.

Firstly, I have a single MQL4 (or MQL5) folder setup on my OneDrive directory. This mainly for saving to the cloud (backup) and for shared access with my VPS.  

Then I use NTFS junction points (as mentioned in previous post) to then have that folder be "shared" with each of my MetaTrader installations, on my PC and on my VPS.

When you write code and compile, given that there is essentially only one MQL folder, all source and executable files are available to all installations locally and remotely.

Dominik Christian Egert
2157

One thing I would like to point out concerning hard links or junctions, you need to be aware, the filesystem does not consistently communicate filehandles, as they differe in their path.

What I mean is following. Lets say you have one source folder and you have a hard link set up to show that source folders contetn on a different spot within the filesystem, when you start editing a file, following needs to be considered:

Opening a file in the original source location, and opening the same file using the junction/hard link, the second editor will not be informed of updates to the file as you save the file in the source location/first editor. And vice-versa.

This means, you have to take extra precaution to not edit the same file in two locations at the same time. - They will unnoticed overwrite each other. 


Very unplesant behaviour of NTFS, but thats the way it is. - Only way around this is using a cluster filesystem, which (I suspect) is not available to you, as it is part of the Windows Server Datacenter edition only.


 Just be careful when editing the same file from "shadowed" locations at the same time.

Fernando Carreiro
10044
Dominik Christian Egert #: One thing I would like to point out concerning hard links or junctions, you need to be aware, the filesystem does not consistently communicate filehandles, as they differe in their path. What I mean is following. Lets say you have one source folder and you have a hard link set up to show that source folders contetn on a different spot within the filesystem, when you start editing a file, following needs to be considered: Opening a file in the original source location, and opening the same file using the junction/hard link, the second editor will not be informed of updates to the file as you save the file in the source location/first editor. And vice-versa. This means, you have to take extra precaution to not edit the same file in two locations at the same time. - They will unnoticed overwrite each other. Very unplesant behaviour of NTFS, but thats the way it is. - Only way around this is using a cluster filesystem, which (I suspect) is not available to you, as it is part of the Windows Server Datacenter edition only. Just be careful when editing the same file from "shadowed" locations at the same time.

@Dominik Christian Egert, actually, it is not the the NTFS which is misbehaving, but the applications that are misbehaving. NTFS does in fact behave correctly and report the updates, but if the application does not monitor this and act accordingly, it will not update. This is the case of MetaEditor.

However, if you use an editor that does monitor this, for example VSCode, then the situation is in fact detected and the file updated with the new content. Here is a short GIF animation showing this. On the right is MetaEditor with the original file open (a .mq5 file). On the left is VSCode opening a Hard Link of a Junction point (double redirection), an ".mq4" file in another folder. You can see that as soon as I save (compile) the file in MetaEditor it is immediately updated in the VSCode editor (expand the image below, to see the animation):


Dominik Christian Egert
2157
Maybe I got this wrong, but as far as I am aware, this is a limitation as documented by MS.

I would guess, VScode does more file monitoring.

Here from the link I posted.

"However, the directory entry size and attribute information is updated only for the link through which the change was made. Note that the attributes on the file are reflected in every hard link to that file, and changes to that file's attributes propagate to all the hard links. For example if you reset the READONLY attribute on a hard link to delete that particular hard link, and there are multiple hard links to the actual file, then you will need to reset the READONLY bit on the file from one of the remaining hard links to bring the file and all remaining hard links back to the READONLY state."

I am not sure, as I would need to dig in deeper, but as far as I remember from my MCA course, it is a limitation of NTFS, which is not the case on ext2/3 or reiserFS, BTRFS, ZFS...

But I could be wrong.
Fernando Carreiro
10044
Dominik Christian Egert #: Maybe I got this wrong, but as far as I am aware, this is a limitation as documented by MS. I would guess, VScode does more file monitoring. Here from the link I posted.

"However, the directory entry size and attribute information is updated only for the link through which the change was made. Note that the attributes on the file are reflected in every hard link to that file, and changes to that file's attributes propagate to all the hard links. For example if you reset the READONLY attribute on a hard link to delete that particular hard link, and there are multiple hard links to the actual file, then you will need to reset the READONLY bit on the file from one of the remaining hard links to bring the file and all remaining hard links back to the READONLY state."

I am not sure, as I would need to dig in deeper, but as far as I remember from my MCA course, it is a limitation of NTFS, which is not the case on ext2/3 or reiserFS, BTRFS, ZFS...

But I could be wrong.

@Dominik Christian Egert, I think it may be a case of misinterpretation of Microsoft's documentation. To me, it clearly states that the changes to the file attributes are propagated to all links. It is only directories changes that are independent of one another, in the case of hard links in those directories. However Junction points are the equivalent of Hard Links for directories and their properties are also propagated.

Also, given that VSCode is written in JavaScript, I don't see it using any "backdoor" to circumvent the normal NTFS operations.

EDIT: Please note also, that there is a difference between file attributes and file content, and the documentation you quoted is referring to attributes and not content.

forextastic
49
forextastic  
Thanks to everyone for the advice! I do not hide that I did not understand the whole conversation but I am trying to deepen.
Do you think this is a valid tutorial for this procedure?

https://www.youtube.com/watch?v=RrJgH-YiiiY

I have Windows 11 but i think it's the same.
How to create and delete a junction link on Windows 10
How to create and delete a junction link on Windows 10
  • 2019.01.09
  • www.youtube.com
You’ve probably heard of symbolic links, and how useful they are. You can create a symbolic link on Windows, Mac, and Linux. Symbolic links are more capable ...
forextastic
49
forextastic  
forextastic # :
Thanks to everyone for the advice! I do not hide that I did not understand the whole conversation but I am trying to deepen.
Do you think this is a valid tutorial for this procedure?

https://www.youtube.com/watch?v=RrJgH-YiiiY

I have Windows 11 but i think it's the same.

I managed without problems and immediately with this tutorial, it works perfectly and being able to do it even with a cloud service like dropbox or others is very very interesting.
Thanks!

Fernando Carreiro
10044
forextastic #: I managed without problems and immediately with this tutorial, it works perfectly and being able to do it even with a cloud service like dropbox or others is very very interesting. Thanks!
You are welcome!