Different colors for DRAW_ZIGZAG in MT4.

 
Hi every one, I've been trying to create a zigzag indicator using DRAW_ZIGZAG in MT4, I want to change the color of the zigzag line for up and down lines, but seems like the color won't change, does anyone know how to change the color of zigzag line indicator?
The ZigZag Indicator: Fresh Approach and New Solutions
The ZigZag Indicator: Fresh Approach and New Solutions
  • www.mql5.com
The article examines the possibility of creating an advanced ZigZag indicator. The idea of identifying nodes is based on the use of the Envelopes indicator. We assume that we can find a certain combination of input parameters for a series of Envelopes, whereby all ZigZag nodes lie within the confines of the Envelopes bands. Consequently, we can try to predict the coordinates of the new node.
Files:
Zigzag.png  76 kb
 
Fatemeh Ameri: Hi every one, I've been trying to create a zigzag indicator using DRAW_ZIGZAG in MT4, I want to change the color of the zigzag line for up and down lines, but seems like the color won't change, does anyone know how to change the color of zigzag line indicator?

MQL4 does not support "DRAW_ZIGZAG". You have to simulate it in MQL4.

Use a different buffer for each colour, with EMPTY_VALUE in the data for the buffers of the different colour to the one you want plotted.

Look in the CodeBase for an examples of changing colours on plots.

 
Fernando Carreiro #:

MQL4 does not support "DRAW_ZIGZAG". You have to simulate it in MQL4.

Use a different buffer for each colour, with EMPTY_VALUE in the data for the buffers of the different colour to the one you want plotted.

Look in the CodeBase for an examples of changing colours on plots.

MQL4 supports DRAW_ZIGZAG, I created the indicator which I attach its picture in MQL4 using  DRAW_ZIGZAG, The only issue is I cannot change the indicator color for the up and dn directions. 

 
Fatemeh Ameri #: MQL4 supports DRAW_ZIGZAG, I created the indicator which I attach its picture in MQL4 using  DRAW_ZIGZAG, The only issue is I cannot change the indicator color for the up and dn directions. 

My apologies! When I read your post I assumed you were referring to "DRAW_COLOR_ZIGZAG", even though you wrote it correctly and I even quoted it. The mind plays funny tricks on us old folk.😅

However, what you are requesting, namely a colour change, is in fact a similar functionality of the "DRAW_COLOR_ZIGZAG". So, my statement earlier is still valid in respect that you will need to simulate it with individual buffers for the different colours.

EDIT: But you will have to use a different drawing style, other than "DRAW_ZIGZAG" to switch between the plot colours by making use of the EMPTY_VALUE in the buffers.

 
Hi, you can use the zigzag code to fill yoir own buffer with peak value and then draw trendline to link peak with color condition
 
Raymond Codjia #: Hi, you can use the zigzag code to fill yoir own buffer with peak value and then draw trendline to link peak with color condition

No! Using trend-lines is inefficient and convoluted. Why do that when buffers can accomplish the job?

 
Fernando Carreiro #:

My apologies! When I read your post I assumed you were referring to "DRAW_COLOR_ZIGZAG", even though you wrote it correctly and I even quoted it. The mind plays funny tricks on us old folk.😅

However, what you are requesting, namely a colour change, is in fact a similar functionality of the "DRAW_COLOR_ZIGZAG". So, my statement earlier is still valid in respect that you will need to simulate it with individual buffers for the different colours.

EDIT: But you will have to use a different drawing style, other than "DRAW_ZIGZAG" to switch between the plot colours by making use of the EMPTY_VALUE in the buffers.

What drawing style can I use to give me the look of a Zigzag other than DRAW_ZIGZAG? You know, I need those different buffers with different colors  to connect to each other and create a zigzag shape.

Note: In this Zigzag indicator sometimes on one single candle the high must connect to low or visa versa. Plz check the picture I attached to find out what I am talking about.
 
Raymond Codjia #:
Hi, you can use the zigzag code to fill yoir own buffer with peak value and then draw trendline to link peak with color condition

I think it can work, but lot of trendline objects must be created in the chart.

 
Fernando Carreiro #:

MQL4 does not support "DRAW_ZIGZAG". You have to simulate it in MQL4.

Use a different buffer for each colour, with EMPTY_VALUE in the data for the buffers of the different colour to the one you want plotted.

Look in the CodeBase for an examples of changing colours on plots.

I've searched the code base, for MT5 I found it, but there is no such a zigzag indicator with different colors for MT4.

 
Fatemeh Ameri #: I've searched the code base, for MT5 I found it, but there is no such a zigzag indicator with different colors for MT4.

Then look at the examples of a coloured moving average, and adopt it to a ZigZag.

I also stated that you will have to use a different drawing style and not "DRAW_ZIGZAG". You will have to simulate the equivalent of the ZigZag style using a different drawing style.

I cannot offer you any code sample, because I have no such example to give you nor am I going to put in the work to develop it for you. You will have to research it and think about it to come up with your own code. That is what development is about. To use the different tools available and adapt them to form a solution.

EDIT: You are a freelance developer and sell market products. So doing the development for you for free for something that you might sell as product or use for your freelance jobs does not seem correct.

 
Fernando Carreiro #:

Then look at the examples of a coloured moving average, and adopt it to a ZigZag.

I also stated that you will have to use a different drawing style and not "DRAW_ZIGZAG". You will have to simulate the equivalent of the ZigZag style using a different drawing style.

I cannot offer you any code sample, because I have no such example to give you nor am I going to put in the work to develop it for you. You will have to research it and think about it to come up with your own code. That is what development is about. To use the different tools available and adapt them to form a solution.

EDIT: You are a freelance developer and sell market products. So doing the development for you for free for something that you might sell as product or use for your freelance jobs does not seem correct.

I just have to be sure if it us possible.
The issue is that I think it is not possible.

But thanks for all your help.
Reason: