Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
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