how to get color for the candle in my EA ?

 

hi experts,

i'm new programmer in MQL5, so if my question is very easy i'm sorry.

 i'm create  one EA and i use one custom indicator  with a function ICustom, this indicator change candle color. I need to know what the candle color this so that my EA can take the decision to buy or sell.

 

Tnks for your attention.

 Igor Vilela 

 
rogivilela:

hi experts,

i'm new programmer in MQL5, so if my question is very easy i'm sorry.

 i'm create  one EA and i use one custom indicator  with a function ICustom, this indicator change candle color. I need to know what the candle color this so that my EA can take the decision to buy or sell.

 

Tnks for your attention.

 Igor Vilela 

I believe the triggering signal comes from the evaluation of iCustom function to make the decision, or at least, this is the thing that I'm doing.
 
Osama Shaban:
I believe the triggering signal comes from the evaluation of iCustom function to make the decision, or at least, this is the thing that I'm doing.
No, the my  ICustom don't returning nothing.  so I need to get the value of the candle color, because if it turns green I make a purchase, if it goes vermelhor I make a sale.
 
rogivilela:
No, the my  ICustom don't returning nothing.  so I need to get the value of the candle color, because if it turns green I make a purchase, if it goes vermelhor I make a sale.
It totally depends on how the indicator has been coded and what values it is outputting to buffers
 
Stuart Browne:
It totally depends on how the indicator has been coded and what values it is outputting to buffers

yes , i know that but this indicator is not coded for me, i found in Internet and i want  use for help my EA. this indicator change the color of candle; Green for up  and Red for Down. 

i gas if my EA can read what candle color, my EA know what to do , Buy or Sell.

sorry for my poor english. :(

 

you best compare price levels.

the color of the candle is also derived from the price levels so you can use that directly in stead of trying to use the color which can be dramatic.

 
Marco vd Heijden:

you best compare price levels.

the color of the candle is also derived from the price levels so you can use that directly in stead of trying to use the color which can be dramatic.

i understand, but this indicator no change color based from the price.

i just want know how i can get color value from candle plz.

 

If price does not determine the color of the candle, then what does?

   color bull_body=ChartGetInteger(NULL,CHART_COLOR_CANDLE_BULL);//--- Get the color of bullish candlestick's body                                                    
   color bull_up=ChartGetInteger(NULL,CHART_COLOR_CHART_UP);     //--- Get the color of up bar, its shadow of a bullish candlestick       
   color bear_body=ChartGetInteger(NULL,CHART_COLOR_CANDLE_BEAR);//--- Get the color of bearish candlestick's body   
   color bear_down=ChartGetInteger(NULL,CHART_COLOR_CHART_DOWN); //--- Get the color of down bar, of bearish candlestick's body 
 
Marco vd Heijden:

If price does not determine the color of the candle, then what does?

thank you, but unfortunately not the return matches the value of the candle color. :(
 
it should return the color values of the candles.
 
rogivilela:

hi experts,

i'm new programmer in MQL5, so if my question is very easy i'm sorry.

 i'm create  one EA and i use one custom indicator  with a function ICustom, this indicator change candle color. I need to know what the candle color this so that my EA can take the decision to buy or sell.

 

Tnks for your attention.

 Igor Vilela 

Check it with various "mode" in your iCustom. Try it from 0, 1, ... . Dont forget to check the value with Data Window (Ctrl+D) in MT terminal.

double  iCustom( 
   string       symbol,           // symbol 
   int          timeframe,        // timeframe 
   string       name,             // path/name of the custom indicator compiled program 
   ...                            // custom indicator input parameters (if necessary) 
   int          mode,             // line index 
   int          shift             // shift 
   );
Reason: