Use an Array
colombodave:
Can I declare variables in a loop, each with a different name?
So I would end up with a variable for each order ie.
varXXXXXXXX = 1.2548
varYYYYYYYY = 0.8849
varZZZZZZZZ = 110.48
Any help or guidance would be appreciated.
You need to use a mapping object, i.e. a dictionary/hash-map.
CHashMap<int, double> top; for(int i=0; i<OrdersTotal(); i++) if(OrderSelect(i, SELECT_BY_POS)) top.Add(OrderTicket(), OrderOpenPrice());
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Can I declare variables in a loop, each with a different name?
So I would end up with a variable for each order ie.
varXXXXXXXX = 1.2548
varYYYYYYYY = 0.8849
varZZZZZZZZ = 110.48
Any help or guidance would be appreciated.