You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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