Colored background band between Envelope lines

 

Hi All,


I am trying to colorize background band between Envelope lines.

The code I've written could not create the required effect.

If you could kindly help, I'll be truly appreciated.


JP



int start()
{
int limit;
if(Bars <= MA_Period) return(0);
ExtCountedBars = IndicatorCounted();

if (ExtCountedBars < 0) return(-1);

if (ExtCountedBars > 0) ExtCountedBars--;
limit = Bars - ExtCountedBars;

ObjectCreate( "oName", OBJ_RECTANGLE, 0, 0, 0, 0, 0);
ObjectSet ( "oName", OBJPROP_STYLE, STYLE_SOLID);
ObjectSet ( "oName", OBJPROP_BACK, false);
ObjectSet ( "oName", OBJPROP_COLOR, Red);


for(int i=0; i<limit; i++)
{
ExtMapBuffer1[i] = ( 1 + Deviation / 100) * iMA(NULL, 0, MA_Period, 0, MA_Method, Applied_Price, i);
ExtMapBuffer2[i] = ( 1 - Deviation / 100) * iMA(NULL,0, MA_Period, 0, MA_Method, Applied_Price, i);

ObjectSet ( "oName", OBJPROP_TIME1, Time[i]);
ObjectSet ( "oName", OBJPROP_PRICE1, ExtMapBuffer1[i]);
ObjectSet ( "oName", OBJPROP_TIME2, Time[i]);
ObjectSet ( "oName", OBJPROP_PRICE2, ExtMapBuffer2[i]);
}

return(0);
}




envelopebkg

 

Name for each object you create must be unique.

try baseName+i

 

Thank You phy, I am appreciated.

I'll update you on my progress.


JP

Reason: