# How to know what is the color of the candle on chart with open == close?

769

Hello everyone,

I was trying to collect the data with MT5 and only the OHLC values  of the candles with the their respective color. I am quite confused, when I see that my data say nothing about the candles as shown in the figure:

As I am collecting the candles data with their respective color using the following code:

```if(open[0] > close[0])
colorcandle = "Red"
if(open[0] < close[0])
colorcandle = "Green"
if(open[0] == close[0])
colorcandle = "Nocolor"

```

I clearly see that the candle shown in the figure are green but the collected data shown me that the candle has Nocolor

Kindly, let me know how I can decide the color of the candle as the logic is failing to detect such condition.

2774

[0]  or [i] ?

981

It has the Line Color or some of the Bull/Bear Bar colors I think.
1174

jaffer wilson:

Hello everyone,

I was trying to collect the data with MT5 and only the OHLC values  of the candles with the their respective color. I am quite confused, when I see that my data say nothing about the candles as shown in the figure:

As I am collecting the candles data with their respective color using the following code:

I clearly see that the candle shown in the figure are green but the collected data shown me that the candle has Nocolor

Kindly, let me know how I can decide the color of the candle as the logic is failing to detect such condition.

A candle with O == C has NO color. You are using the wrong color on the chart to coloring this situation.

Check for "Line Chart" on Colors.

Moderator
106120

It is doji (I am using this indicator) -

Moderator
8167

it can also be based on the previous candle..
121

jaffer wilson:

Hello everyone,

I was trying to collect the data with MT5 and only the OHLC values  of the candles with the their respective color. I am quite confused, when I see that my data say nothing about the candles as shown in the figure:

As I am collecting the candles data with their respective color using the following code:

I clearly see that the candle shown in the figure are green but the collected data shown me that the candle has Nocolor

Kindly, let me know how I can decide the color of the candle as the logic is failing to detect such condition.

"NoColor" doesn't seem to be a valid value. Even then, it would default to whatever default color the terminal would already have. Try a different color like "Yellow" and see if that works.

769

Thank you all for your reply. But the is not the point which most of the people here are understanding. Let me clarify it.

I am using MQL5 programming language for detecting the color of the candle on the chart. I am collecting the OHLC values along which the chart color. I have planted the logic as I have previously mentioned that. But as shown in the figure the doji candle has O==C, that means my logic will yield Nocolor as the output instead of green or red. But as shown in the figure the doji has green color. so how I can get to know what color the doji is as my logic is failing to detect the color of the candle.

Thats what I mean. Please let me know if I am clear here.

181

jaffer wilson:

Thank you all for your reply. But the is not the point which most of the people here are understanding. Let me clarify it.

I am using MQL5 programming language for detecting the color of the candle on the chart. I am collecting the OHLC values along which the chart color. I have planted the logic as I have previously mentioned that. But as shown in the figure the doji candle has O==C, that means my logic will yield Nocolor as the output instead of green or red. But as shown in the figure the doji has green color. so how I can get to know what color the doji is as my logic is failing to detect the color of the candle.

Thats what I mean. Please let me know if I am clear here.

You haven't really given enough information to go on

Everyone is correct in that the O==C should be no colour (you obviously know green means it closed higher than opening and red vice versa, so it's not hard to understand that open=close doesn't fall into this logic)

But it seems the chart you looking at assigns this a colour, going on your chart I'd say they're always green

769

Sergey Golubev:

It is doji (I am using this indicator) -

Yeah, I wanted to know the color of such candles. Can you help me with that?

769

iRick:

You haven't really given enough information to go on

Everyone is correct in that the O==C should be no colour (you obviously know green means it closed higher than opening and red vice versa, so it's not hard to understand that open=close doesn't fall into this logic)

But it seems the chart you looking at assigns this a colour, going on your chart I'd say they're always green

That's what I needed to identify using the code. can you help with that? As my logic is failing. Is there anything in the MQL that can help me? Please do let me know.