In an EA I need to search a predefined list of currency pairs for a specific pair and return the corresponding value. The pair to be searched for is declared as an input at the start of the script.
In the example below, how would I search for “EURCAD” and have it return the value 3.0?
extern string Pair=“EURCAD”;
EURAUD=6.0
EURCAD=3.0
EURCHF=6.0
EURCZK=13.0
EURDKK=13.0
EURGBP=6.0
EURHKD=13.0
Could someone kindly provide example code as it relates to this scenario? I’ve been searching hours now for the best way to achieve this and I’m stuck.
Thank you for the assistance!