J'utilise un CCI en ut30. Je l'utilise pour sa voir dans quel sens je vais rentré en UT5 ou ut1.
Pour un simple soucis de visibilité je voudrais que quand mon CCI ut30 est à la hausse ça désine une barre Bleu et quand il est à la baisse je voudrais qu'il dessine une ligne rouge (ou bien un Histograme)

Par exemple sur cette image vous voyez 2 indicateur, en haut le miens (qui foire complètement comme vous pouvez le constater)
Et en bas un exemple de se que je voudrais, mais avec seulement des barres Bleu et rouge.
Voici mon code
CODE
//+------------------------------------------------------------------+
//| IMPEM30.mq4 |
//| Copyright © 2006, MetaQuotes Software Corp. |
//| http://www.mataf.net |
//+------------------------------------------------------------------+
#property copyright "Imperatorfr"
#property link "http://www.mataf.net"
#property indicator_separate_window
#property indicator_minimum 0
#property indicator_maximum 1
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red
//---- buffers
double TrendUp[];
double TrendDown[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0, DRAW_HISTOGRAM, STYLE_SOLID, 2);
SetIndexBuffer(0, TrendUp);
SetIndexStyle(1, DRAW_HISTOGRAM, STYLE_SOLID, 2);
SetIndexBuffer(1, TrendDown);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int i;
int counted_bars=IndicatorCounted();
int limit;
double T3Current, T3Previous;
T3Current=iCustom(NULL,30,"ImperINDIC",PRICE_CLOSE,i);
T3Previous=iCustom(NULL,30,"ImperINDIC",PRICE_CLOSE,i+1);
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
for(i=0; i<limit; i++)
if(T3Previous<T3Current) TrendUp[i]=1;
if(T3Previous<T3Current) TrendDown[i]=1;
//----
return(0);
}
//+------------------------------------------------------------------+