Hi
I am very new to MQL4 programming. But I am programming in another language.
I an trying to learn CHashMap to store key/value pairs in my test.
I show this example using CHashMap online
When add this code in my script EA, I am getting errors. I guess, I need to import this CHashMap Library.
void OnStart() {
CHashMap<string, int> d;
d.Add("one", 1);
d.Add("two", 2);
d.Add("three", 3);
}
Please can someone help me, who to add library to my code.
Many thanks
Ish
You must include the HashMap.mqh:
#include <Generic\HashMap.mqh>
I tried what you suggested, as shown below. I am still getting error. I am using MT4 platform from Oanda.
#property strict
#include <Generic\HashMap.mqh>
void OnStart(){
CHashMap<string, int> d;
d.Add("one", 1);
d.Add("two", 2);
d.Add("three", 3);
}
Please any advicePlease write your code in this field by pressing Alt + S key.
I tried what you suggested, as shown below. I am still getting error. I am using MT4 platform from Oanda.
#property strict
#include <Generic\HashMap.mqh>
void OnStart(){
CHashMap<string, int> d;
d.Add("one", 1);
d.Add("two", 2);
d.Add("three", 3);
}
Please any adviceHere is my code: I get no compiler errors, no warnings. All is ok. I cannot see any problem(?)
#property strict #include <Generic/HashMap.mqh> void OnStart() { CHashMap<string, int> d; d.Add("one", 1); d.Add("two", 2); d.Add("three", 3); }
Matthias
BTW: I'm using Metatrader 5, Build 2863BTW: I'm using Metatrader 5, Build 2863
Then why are you posting in the MT4 section??
- 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
I am very new to MQL4 programming. But I am programming in another language.
I an trying to learn CHashMap to store key/value pairs in my test.
I show this example using CHashMap online
When add this code in my script EA, I am getting errors. I guess, I need to import this CHashMap Library.
void OnStart() {
CHashMap<string, int> d;
d.Add("one", 1);
d.Add("two", 2);
d.Add("three", 3);
}
Please can someone help me, who to add library to my code.
Many thanks
Ish