[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 703

 
I've already written that I realise string doesn't work, but what about it?
 
Infinity:
I've already written that I realise string doesn't work, but what about it?
Use the if statement
 
OneDepo:
Use the if statement

That's what I thought at first, I just wanted to make the code shorter ))))) too many ifs I would get)
 
odiseif:
SetIndexStyle(0, DRAW_NONE);
SetIndexStyle(1, DRAW_LINE,EMPTY);
SetIndexStyle(2, DRAW_NONE);
SetIndexStyle(3, DRAW_NONE);
SetIndexStyle(4, DRAW_NONE);
it is here .......I want to set the line width to 0 but I don't want to bother with the settings ...... I don't know how to do it .... I'm not a programmer .... help me ))))

Odyssey, there are two options. First, at the very beginning of the indicator code, change the digit at the end of this line, to the desired thickness:

#property  indicator_width1  1

Or via method SetIndexStyle():

SetIndexStyle(1, DRAW_LINE, EMPTY, 2); 

Line thickness, in this method, the fourth parameter.

 
ToLik_SRGV:

Odyssey, there are two options. First, at the very beginning of the indicator code, change the digit at the end of this line, to the desired thickness:

Or via method SetIndexStyle():

Line thickness, in this method, is the fourth parameter.

 IndicatorBuffers(7);
   SetIndexBuffer(0, MACDBuffer);
   SetIndexBuffer(1, SignalBuffer);
   SetIndexBuffer(2, FastEMABuffer);
   SetIndexBuffer(3, SlowEMABuffer);
   SetIndexBuffer(4, SignalEMABuffer);
   SetIndexBuffer(5, Buffer1);
   SetIndexBuffer(6, Buffer2);
   SetIndexStyle(0, DRAW_NONE);
   SetIndexStyle(1, EMPTY);
   SetIndexStyle(2, DRAW_NONE );
   SetIndexStyle(3, DRAW_NONE );
   SetIndexStyle(4, DRAW_NONE);
   SetIndexStyle(5, DRAW_HISTOGRAM);
   SetIndexStyle(6, DRAW_HISTOGRAM);
   SetIndexDrawBegin(0, SlowEMA);
   SetIndexDrawBegin(1, SlowEMA);
here is a piece of code here ..i found it in the tutorial but can't figure it out .... should i change it or paste it ?
 
Poushkine:

I don't know anything about programming at all. I wanted to make CCI Filter (https://www.forex-tsd.com/indicators-metatrader-4/3356-cci-filter.html) the same for WPR, changed CCI to WPR and changed levels in coloring conditions of bars (not -100, 0, 100 like CCI, but -60, -50 and -40, because in MT WPR has range -100 to 0, I think, right?) But for some reason it compiles with an error, and the screen shows a monochrome indicator. What is wrong? Thanks in advance

I don't fully understand what exactly you changed, because you have to register at the address you provided to look through the source code of the CCI Filter.
Found only one error, iWPR has no applied_price parameter, so this is correct:

WPR0=iWPR(NULL,0,PeriodWPR,shift);
 
odiseif:
here's a piece of code here ..i found it in the tutorial but i can't figure it out .... should i change it or paste it ?

Isn't there a line like this at the beginning of the code:

#property  indicator_width1  1

If not, then try this:

SetIndexStyle(5, DRAW_HISTOGRAM, EMPTY, 2);
SetIndexStyle(6, DRAW_HISTOGRAM, EMPTY, 2);
 

Also Odysseus, in the previous example you had it like this:

SetIndexStyle(0, DRAW_NONE);
SetIndexStyle(1, DRAW_LINE,EMPTY);
SetIndexStyle(2, DRAW_NONE);
SetIndexStyle(3, DRAW_NONE);
SetIndexStyle(4, DRAW_NONE);

And now it's like this:

SetIndexStyle(0, DRAW_NONE);
SetIndexStyle(1, EMPTY);
SetIndexStyle(2, DRAW_NONE );
You didn't delete anything, or am I imagining it?
 
ToLik_SRGV:

Isn't there a line like this at the beginning of the code:

If not, then try this:

there's no such line.
#property  indicator_width1  1

 

I changed it like this and it's not working properly ... the histogram is changing in the terminal with new parameters but when I pull a new indicator on a chart it shows the same parameters as before ...


 IndicatorBuffers(7);
   SetIndexBuffer(0, MACDBuffer);
   SetIndexBuffer(1, SignalBuffer);
   SetIndexBuffer(2, FastEMABuffer);
   SetIndexBuffer(3, SlowEMABuffer);
   SetIndexBuffer(4, SignalEMABuffer);
   SetIndexBuffer(5, Buffer1);
   SetIndexBuffer(6, Buffer2);
   SetIndexStyle(0, DRAW_NONE);
   SetIndexStyle(1, DRAW_LINE,EMPTY);
  SetIndexStyle(2, DRAW_LINE,EMPTY,2 );
   SetIndexStyle(3, DRAW_NONE,EMPTY,2);
   SetIndexStyle(4, DRAW_NONE);
   SetIndexStyle(5, DRAW_HISTOGRAM,EMPTY, 2);
   SetIndexStyle(6, DRAW_HISTOGRAM,EMPTY, 2);
   SetIndexDrawBegin(0, SlowEMA);
   SetIndexDrawBegin(1, SlowEMA);
   IndicatorShortName("ZeroLag MACD Colored(" + FastEMA + "," + SlowEMA + "," + SignalEMA + ")");
   SetIndexLabel(0, "MACD");
   SetIndexLabel(1, "Signal");
   SetIndexLabel(5, "MACD");
   SetIndexLabel(6, "MACD");
Reason: