#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? :)
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? :)
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.
What a productive thread, 2 quoestions, 3 answers!
Thanks guys!
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 ;-).
Hi,
within the EA it is simple to get the name of my EA using following code:
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:
Kind Regards
Resurrecting this dated thread because I, too, would like to do just that -- read the #property version for using dynamically inside my MQL programs... Is that possible? If so, how?
Just as explained in post #1, use macro substitution instead. This is my rendition ...
//--------------------------------------------------------------------------------------------------------------------- #define MName "Renko Cross" #define MVersion "0.5 alpha" #define MBuild "2022-06-15 13:30 WEST" #define MCopyright "Copyright \x00A9 2022, Fernando M. I. Carreiro, All rights reserved" #define MProfile "https://www.mql5.com/en/users/FMIC" #define MCommentCode "RC1" //--------------------------------------------------------------------------------------------------------------------- #property strict #property version MVersion #property description MName #property description "MetaTrader Expert Advisor (Build "MBuild")" #property copyright MCopyright #property link MProfile //---------------------------------------------------------------------------------------------------------------------
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
within the EA it is simple to get the name of my EA using following code:
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:
Kind Regards