I wish to choose the color of a indicator in a EA.

 
Hello,

I wish to choose the color of a indicator in a EA.

is it possible?

How code it ?


Thank you.

//+------------------------------------------------------------------+
//|                                                 CouleurIndic.mq4 |
//|                        Copyright 2013, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2013, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

double maShort;
double maLong;

extern double PeriodShort    = 12;
extern double PeriodLong     = 50;

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   maShort=iMA(NULL,0,PeriodShort,0,MODE_SMA,PRICE_CLOSE,0);
   maLong=iMA(NULL,0,PeriodLong,0,MODE_SMA,PRICE_CLOSE,0);

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
 
tintin92
I wish to choose the color of a indicator in a EA.
is it possible?
Not possible. 1) There are no indicator's in EA's. 2) EA can only get their values. 3) There is no color in values.
maShort=iMA(NULL,0,PeriodShort,0,MODE_SMA,PRICE_CLOSE,0);
maLong=iMA(NULL,0,PeriodLong,0,MODE_SMA,PRICE_CLOSE,0);

Do you see any colors there? Only a double called maShort and a double called maLong.

You have only three choices: Search for it, learn to code, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt and the nature of your problem.

 
tintin92:
Hello,

I wish to choose the color of a indicator in a EA.

is it possible?

How code it ?


Thank you.

I think I saw a colorful MA in forum somewhere some time ago so I search again. Took me time to find this https://www.mql5.com/en/forum/139547
 
phi.nuts:
I think I saw a colorful MA in forum somewhere some time ago so I search again. Took me time to find this https://www.mql5.com/en/forum/139547
It's an EA though not an Indicator . . . 
 
tintin92:
Hello,

I wish to choose the color of a indicator in a EA.

is it possible?

How code it ?

There is no Indicator . . .  you are calling a function and it returns a value.
 
RaptorUK:
It's an EA though not an Indicator . . . 

Thank you very much :). I must be tired (and so not focusing) yesterday.


Well, if the MA is attached to chart, you can change its color from EA using some Global variables function. 

Reason: