Download MetaTrader 5

How to get #property version from EA?

To add comments, please log in or register
MrGrey
9412
MrGrey  

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
1990
graziani  
#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
19835
Stanislav Korotky  
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
9412
MrGrey  
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
1990
graziani  

What a productive thread, 2 quoestions, 3 answers!

Thanks guys! 

Stanislav Korotky
19835
Stanislav Korotky  
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
9412
MrGrey  
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