Download MetaTrader 5
To add comments, please log in or register
MQL5 language supports OpenCL. Try it!
MrGrey
8055
MrGrey 2014.09.03 11:47 

Hi, 

within the EA it is simple to get the name of my EA using following code:

MQL5InfoString(MQL5_PROGRAM_NAME)

But I couldn't figure out to get the version number of the version #property field. Is there a similar way to get the version number? My workaround at the moment is a #define after the version number but that's not really satisfying and looks like this:

#property   version     "1.32"
#define     VERSION     "1.32"

 Kind Regards

graziani
1943
graziani 2014.09.03 22:44  
#define VERSION "1.32"
#property version VERSION
string strategyName = "My Indicator V" + VERSION;
string shortStrategyName = "MI" + VERSION;

My problem is that I name my files like "My indicator 1.32.mq4" and then this is readable in properties as "My Indicator 1.32 1.32".
Of course i keep sources of different revisions, so they must have logical names..... 

Any help for that? :) 

Stanislav Korotky
17352
Stanislav Korotky 2014.09.03 23:20  
graziani:

My problem is that I name my files like "My indicator 1.32.mq4" and then this is readable in properties as "My Indicator 1.32 1.32".
Of course i keep sources of different revisions, so they must have logical names..... 

Any help for that? :) 

I add version number to a file name only for outdated versions, while latest version is always without a version suffix. For example, if version 1.32 is being released, I change existing (old) file to "name1.31.mq*" and save version 1.32 under "name.mq*". When 1.33 will be released, this "name.mq*" will go to archive under "name1.32.mq*" and so on.
MrGrey
8055
MrGrey 2014.09.04 00:40  
graziani:

My problem is that I name my files like "My indicator 1.32.mq4" and then this is readable in properties as "My Indicator 1.32 1.32".
Of course i keep sources of different revisions, so they must have logical names..... 

Any help for that? :) 

Your code is a great idea to start with - thanks. 

Regarding the EA file version numbering I switched to MQL5 storage so I don't need the manual file-name based numbering anymore. Versioning is done by SubVersion now. Great advantage is that I can compare differences of my source files very easily.

graziani
1943
graziani 2014.09.04 10:50  

What a productive thread, 2 quoestions, 3 answers!

Thanks guys! 

Stanislav Korotky
17352
Stanislav Korotky 2014.09.04 10:51  
MrGrey:

Regarding the EA file version numbering I switched to MQL5 storage so I don't need the manual file-name based numbering anymore. Versioning is done by SubVersion now. Great advantage is that I can compare differences of my source files very easily.

Yes. Also it's possible to install a version control system locally, for example, Git. Some people may be worried about "sharing" their code with 3-rd parties. You know, sometimes even great and secure services get hacked and then we see, for example, nude celebrities photos from their private albums ;-).
MrGrey
8055
MrGrey 2014.09.04 12:39  
marketeer:
Yes. Also it's possible to install a version control system locally, for example, Git. Some people may be worried about "sharing" their code with 3-rd parties. You know, sometimes even great and secure services get hacked and then we see, for example, nude celebrities photos from their private albums ;-).
You are right. I installed VisualSVN on my local computer and it works great.
/
To add comments, please log in or register