How to change a color to None?
To the background color, black? I think that's the only way possible. Or just change
it to some extreme value so it won't show up on the chart. (Or both)
You can change a style of indicator in init() function. For example:
//+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators IndicatorBuffers(8); SetIndexStyle(0,DRAW_ZIGZAG); SetIndexBuffer(0,HighSwings); SetIndexEmptyValue(0,0.0); SetIndexLabel(0,"HighSwing"); SetIndexStyle(1,DRAW_ZIGZAG); SetIndexBuffer(1,LowSwings); SetIndexEmptyValue(1,0.0); SetIndexLabel(1,"LowSwing"); SetIndexBuffer(2,HighsBuffer); SetIndexLabel(2,"HighActive"); SetIndexEmptyValue(2,0.0); SetIndexBuffer(3,LowsBuffer); SetIndexLabel(3,"LowActive"); SetIndexEmptyValue(3,0.0); if (ShowHiLo) { SetIndexStyle(2,DRAW_ARROW); SetIndexArrow(2,159); SetIndexStyle(3,DRAW_ARROW); SetIndexArrow(3,159); } else { SetIndexStyle(2,DRAW_NONE); SetIndexStyle(3,DRAW_NONE); } SetIndexBuffer(4,UpCloseOutSideBuffers); SetIndexStyle(4,DRAW_ARROW); SetIndexArrow(4,108); SetIndexLabel(4,"UpClose"); SetIndexEmptyValue(4,0.0); SetIndexBuffer(5,DownCloseOutSideBuffers); SetIndexStyle(5,DRAW_ARROW); SetIndexArrow(5,108); SetIndexLabel(5,"DownClose"); SetIndexEmptyValue(5,0.0); SetIndexBuffer(6,Needles); //SetIndexStyle(6,DRAW_NONE); SetIndexEmptyValue(6,0.0); // SetIndexStyle(6,DRAW_ARROW); // SetIndexArrow(6,108); SetIndexBuffer(7,TrendBuffer); SetIndexEmptyValue(7,0.0); for (int i=Bars-1; i>=0; i--) { HighSwings[i]=0.0; LowSwings[i]=0.0; HighsBuffer[i]=0.0; LowsBuffer[i]=0.0; TrendBuffer[i]=0.0; UpCloseOutSideBuffers[i]=0.0; DownCloseOutSideBuffers[i]=0.0; } SwingHigh=0.0; SwingLow=0.0; prevSwing=0; LastSwing=0.0; myBars=0; lowCounter=0; highCounter=0; Comment("\n","GannSwings ",version," kind=",kind); //---- return(0);Full code attached.
Files:
gannswingsxvii.mq4
16 kb
Can anyone tell my how I can take an existing indicator I have and change one of the colors to None so that particular line will not show?
I would like to change something like:
#property indicator_color1 LightSeaGreen
#property indicator_color1 None
but that doesn't work. I've tried changing it to 255.255.255 - and that doesn't work either.
Is there a simple way to do this and I an just not getting it?
Thanks,
Mike