To change colour, then the bar at which colour changes has to have TWO buffer values set:
- the buffer for the PREVIOUS colour, and
- the buffer for the NEXT colour
So ... a colour change is indicated by the presence of 2 buffer values
The new colour is ... the colour for this bar that isn't used for previous bar
![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
Dear All,
I need some help on the following issue.
I have a custom indicator, which display TREND in separate window. There are 3 color used to display TREND
1: Green => Which is show UP TREND
2: RED => Which is show DOWN TREND
3: Yellow => Which is happen between UP TREND and then DOWN TREND
So in summary, it will show the GREEN line then when indicator think that this is the end of the UP TREND, it will show the line in YELLOW, then when indicator think that now there is DOWN TREND, it will display line in RED. Same on the other way, when indicator think that DOWN TREND is over, it will display line in YELLOW then will do GREEN if UP TREND is starting.
What I am trying to do is, I want to get the current indicator line color.
So, from my EA, I am writing the 3 possible buffer used by this indicator to display the colored line.
This is the code:
When line displayed in RED, I see that Buffer0 and Buffer2 have a value.
When line displayed in GREEN, I see that Bufefr0 and Buffer1 have a value.
However, I have an issue to get the YELLOW.
If TREND started to go UP, then before displaying GREEN, it will display YELLOW. When that happen, the same buffers are used as for the GREEN
If TREND started to go DOWN, then before displaying RED, it will display YELLOW. When that happen, the same buffers are used as for the RED.
So how do I know, when Yellow is displayed?
Is anyone out there can help me with this?
Many thanks.
Regards,
Gabor