Topic: Encoding Magic number
Hello Traders,
I'm trying to make the Portfolio feature in EA Studio better. In more details, I want to make a Portfolio Editor to be easier to edit, filter or merge portfolios.
Currently a Portfolio Expert works with a dynamic magic number. It is set at the portfolio expert start in the form of a Base magic number. It works well for now, however I want to make it possible to merge strategies from different portfolios with keeping the strategies magic numbers unchanged. This will work probably better, if EA Studio sets the magic number at the export of the expert.
My idea is to encode some meaning in the number. I checked the MQL docs and found out that the maximal magic number for MT4 is 2147483647 (10 digits).
Here is a possible magic number format:
sssp0cc0nn
where:
sss - the symbol
p - the period
cc - the collection number
nn - the strategy number.
I think that we can preset the most used symbols (customizable of course)
Symbols:
EURUSD 101
USDJPY 102
GBPUSD 103
GOLD 151
SILVER 152
BTCUSD 201
...
Periods:
M1 - 1
M5 - 2
M15 - 3
M30 - 4
H1 - 5
H4 - 6
D1 - 7
MN1 - 8
Example:
1014034056
101 - EURUSD
4 - M30
34 - a collection number 34
56 - strategy number 56 in the current collection.
...
The idea is that EA Studio generates and sets static magic number for each strategy. Later these strategies can be merged in one collection with their original magic numbers.
Please comment and give ideas.