 
//+------------------------------------------------------------------+
//|                                                  true colors.mq4 |
//|                                                           .....h |
//|                                                 hayseedville.com |
//+------------------------------------------------------------------+
#property copyright ".....h"
#property link      "hayseedville.com"
#property indicator_chart_window
extern int  steps       =    80;
extern bool adjustred   =  false;
extern int  redweight   =     0;    // 1, 2 or 3....   such as 3, roughly speakin, throws in 3 times as much red
extern bool adjustblue  =  true;
extern int  blueweight  =     1;    // 1, 2 or 3
extern bool adjustgreen =  false;
extern int  greenweight =     0;    // 1, 2 or 3
 
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
 ObjectsDeleteAll();
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   int i;
//----
      for(i=0;i<steps;i++)  {CreateRectangle(i);}    
 
 
 
 
//----
   return(0);
  }
//+------------------------------------------------------------------+
  void CreateRectangle(double i)
  {
   double   high          = WindowPriceMax();
   double   low           = WindowPriceMin(); 
   datetime left          = Time[WindowFirstVisibleBar()];
   int      red,green,blue;
 
   if(adjustred)   {red   = i*redweight;}
   if(adjustblue)  {blue  = i*blueweight;}
   if(adjustgreen) {green = i*greenweight;}
   blue<<=16;
   green<<=8;
   ObjectCreate("one"+i,OBJ_RECTANGLE, 0, Time[left], (high-((high-low)/steps)*(i-1)), Time[0]+Period()*6000, (high-((high-low)/steps)*(i)));        
   ObjectSet("one"+i, OBJPROP_COLOR, red+blue+green);
 
  }