
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
It is indeed possible, but not the way you think. You have to think "outside of the box".
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?
No, it is not simple! Who are you trying to impress?
The OP has every right to question the possibility because it is in fact a challenge for many coders, to make a colour ZIgZag in MQL4. If it were easy, then there would be many examples of it in the CodeBase and the Market, but there are not. It is however possible, using a few tricks and thinking outside of the box. That I can guarantee.
Note to the OP: @Fatemeh Ameri, when you do finally achieve your goal, don't post the code. Keep it to yourself.
No, it is not simple!
Who are you trying to impress?
It's simple simple ... to change the color if you know how to code and create an indicator from scratch. What a dev you are, eh?
It is not simple, You clearly have no idea how to code it.
No, I don't think so, because it is similar to DRAW_SECTION where it connects the points that don't have EMPTY_VALUE and ignores those that do. It is kind of a "connect the dots" functionality.
The solution I am considering is using the normal DRAW_LINE and simulating the connecting line using the equation "y = mx + c", but there may be other possible solutions, like a combination of the two.
It is a question of analysing each one, pros and cons, and choosing the appropriate one.
No, I don't think so, because it is similar to DRAW_SECTION where it connects the points that don't have EMPTY_VALUE and ignores those that do. It is kind of a "connect the dots" functionality.
The solution I am considering is using the normal DRAW_LINE and simulating the connecting line using the equation "y = mx + c", but there may be other possible solutions, like a combination of the two.
It is a question of analysing each one, pros and cons, and choosing the appropriate one.
I tried to use DRAW_LINE Mode, It does not work as well, In this mode, buffer for all candles must have a value otherwise MT4 does not connect them, so for example you want to connect the low of 2 to the high of 6, we don't have any solution for candles 3,4,5 using DRAW_LINE.
Up to now, the best solution is first creating the indicator using DRAW_ZIGZAG, to change the color of downward lines I used a trendline object, It works like a charm now.
Yes, it does work, but you have to create the intermediate points as well and not just the start and end points. That is why I wrote that you need to apply the equation "y = mx + c" (equation for a line).
And please don't use trend-line graphical objects. That is inefficient.