Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 588
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
There is a problem with classes.
There are two class libraries - the standard MQL4 library and a third-party developer's one. Both of these libraries should be used, but the problem is that they contain some classes with the same name. As a result, I've got ambiguity. The compiler does not know which library I am using the class from.
How to deal with this situation? In C++ this problem can be solved with aliases, in MQL I don't know.
There is a problem with classes.
There are two class libraries - the standard MQL4 library and a third-party developer's one. Both of these libraries should be used, but the problem is that they contain some classes with the same name. As a result, I've got ambiguity. The compiler does not know which library I am using the class from.
How to deal with this situation? In C++ this problem can be solved with aliases, in MQL I don't know.
Put each one in its own namespace.
How do I define a namespace in MQL4? I can't find it. So far, I'm thinking something along these lines:
but I keep getting errors with redefinition. I think I need something else.
How do I define a namespace in MQL4? I can't find it. So far, I'm thinking something along these lines:
but I keep getting errors with redefinition. I think I need something else.
These are two different classes, although they are the same :-))
This is an example for C++, no namespace in MQL4.
I accidentally deleted my reply :-(
I'll have to ask them to do it.
You could try putting it in a class with static members. It's almost the same thing.
Or it may be described in the following way:
I accidentally deleted my reply :-(
I'll have to ask them to do it.
You could try putting it in a class with static members. It's almost the same thing.
Or the same way:
Thanks Vadim, I've already thought about such a way. It won't work for me since the standard class library must be unchanged. With third-party library is funnier :) change it did not want to change anything, but in the end, that would not mess with unnecessary times, changed the name of the class in it and everything associated with it.
I am interested in the ways to avoid this problem using MQL4 tools, without changing class libraries themselves.
Thanks Vadim, I've already thought of a similar way. It won't work for me as the standard class library should be unchanged. I didn't want to change anything in it, but in the end, I changed the class name in the library and everything associated with it, so as not to rack my brains.
I am interested in the ways to avoid this problem using MQL4 tools, without changing class libraries themselves.
Look at the code of the Heiken Ashi indicator
I've already gutted it... There's a histogram, so if you can't find a way to do it with bars, you'll have to use it...
. If you don't care about colours of these labels, you can use this method as in H.A. Just calculate the width of bar in pixels (it's possible, I checked it but I don't remember where it is in Help) and set the bar width, while Open and Close will be the colour specified in the chart properties.