Although I easily fix this by setting a fixed minimum and maximum fixed between both indicators, I do not like this approach.
So, if anyone could suggest another approach, thank you.
You can also set the same range on the affected Indicators by setting the Minimum and Maximum values with the IndicatorSetDouble() function.
ENUM_CUSTOMIND_PROPERTY_DOUBLE
ID |
Description |
Property type |
INDICATOR_MINIMUM |
Minimum of the indicator window |
double |
INDICATOR_MAXIMUM |
Maximum of the indicator window |
double |

- docs.mql4.com
You can also set the same range on the affected Indicators by setting the Minimum and Maximum values with the IndicatorSetDouble() function.
ENUM_CUSTOMIND_PROPERTY_DOUBLE
ID |
Description |
Property type |
INDICATOR_MINIMUM |
Minimum of the indicator window |
double |
INDICATOR_MAXIMUM |
Maximum of the indicator window |
double |
It doesn't help me. As I said I'm already setting the indicator minimum and maximum on both indicator as workaround, but I prefer the other indicator be scale free and I adjust my scale ever time I recalculate. Is it possible? I didn't see any function that allow me to get the minimum/maximum from window or other indicator, so I think IndicatorSetDouble() will not help me...
Thank you.
You can normalize the values of both indicators to the same scale (for example between 0 and 100). Regards.
Then assuming Indicator "A" is the propriety (no code) one, and Indicator "B" is the open-source one, then from within the code of "B", use iCustom() to get the values of "A" and build extra buffers in "B".
In this way, only Indicator "B" will need to be placed on the chart, but will display all the values of both "A" and "B" together at the same scale and range but totally free flowing without the need for minimum or maximum settings.
PS! That is assuming the the values of "A" and "B" are compatible and within a single common range and scale. If they are not, then re-scale them as @Jose Francisco Casado Fernandez suggested (from inside the "B" code using iCustom).

- docs.mql4.com

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello everyone,
I'm trying to make an indicator that can be drawn in the same window with other indicator and I've seen that each indicator has a different range to draw. What do I mean by that? The A indicator and my indicator (let's call it, B) have the same value. So, should both indicators overlap right? Well, the B indicator is drawn too high in relation to the A indicator that is in the same window. Therefore, they are not in the same range of values. I would like to change my code to correct this behavior. Could anyone suggest an approach?
Although I easily fix this by setting a fixed minimum and maximum fixed between both indicators, I do not like this approach.
So, if anyone could suggest another approach, thank you.