Standardized currency pairs 'defined (magic?) numbers' ?

 

I'm encountering some EAs where each currency pair is assigned a unique number. In one case I moved them to a included file CurrencyPairs.mqh (attached) so that some brokers that utilize unique subfixes such as EURUSDiam. This file can readily have other unique definitions added to it to avoid problems of EAs not being able to work with non standardized currency pairs names. Thus one only has to modify one included file that can be used in any EA.

Is their some sort of industry standardized or defacto convention and definition for these?

One instance that I encountered utilizes the format: 66xx99. They use these (magic?) numbers in the EA without defining them which leads me to believe that their must be standardized assignments and definitions for them to reference, though I have no idea where.

Though I have also encountered another EA (attached) that both defines and assigns the pairs numbers (801xxx) and then utilizes these numbers in the same EA as well. This is the one where I moved them to the included file: CurrencyPairs.mqh

If their is such a standardized convention and definition, where can I find them and what are they?

Thanks to any and all for any assistance with this.

 

Found some info:

ForEx Currency Pairs

ISO currency codes (ISO 4217)

But no 'standardized numbers' definition and assignment

Files:
 
In this Epic thread Price-Per-Pip, unique solutions are introduced (among other things). To summarize, the de-facto currently is brokers adding suffixes therefore if you String-Subtract the first 6 characters, you should be fine. Should this convention break in the future, then you'll re-invent the wheel. For now (IMO) this approach is better than a laundry list.
 
ubzen:
In this Epic thread Price-Per-Pip, unique solutions are introduced (among other things). To summarize, the de-facto currently is brokers adding suffixes therefore if you String-Subtract the first 6 characters, you should be fine. Should this convention break in the future, then you'll re-invent the wheel. For now (IMO) this approach is better than a laundry list.


Hi ubzen,

I understand and a good suggestion. However what I can't figure out is where an EA only utilizes numbers to represent currency pairs with out defining what these are. How can the EA & broker know which number is equivalent to which currency pair without it?

 
In both your examples above the currency pairs are being assigned a number. I'm not aware of any standard CODE that reference currency pairs to brokers.
 
You could use some kind of hashing code.... it won't be reversable but it will generate an 'unique' number for each symbol
Reason: