Vertical line. - page 6

 
Nauris Zukas:

Or did you think of doing it differently?


Exactly the other way.

Exclusively according to the current situation... You have to assign a colour by condition, if not a vertical segment, then yellow. That way there will be red on the specified segment, red vertically and red... and overlap the red vertical with the yellow histogram.

 
Alexey Viktorov:

Exactly the other way around.

Exclusively for current situation... We should assign a colour by condition, if not a vertical segment, then yellow. That way there will be red on the specified segment, red vertically and red... and overlap the red vertical with the yellow histogram.

Thank you, it worked. Except... I looked at it this way and I don't really like the end result, which is painted over. I'll try my variant with additional DRAW_COLOR_SECTION buffer.


 
Nauris Zukas:

Thanks, it worked. Except... I looked at it this way and I don't really like the end result, which is painted over. I'll try my variant with additional DRAW_COLOR_SECTION buffer.


But you can read candlestick colours and assign them to the histogram according to the candlestick. And not by high and low, but by open and close.

 
Alexey Viktorov:

But you can read the colours of candlesticks and assign them to the histogram according to the candlestick. And not by high and low, but by open and close.

So, here is more details,"to read candlestick's colours" - what function is used to do it?

 
Nauris Zukas:

So, here, in more detail,"read the colours of the candles" - which function does it use?

   colors[0] = (color)ChartGetInteger(0, CHART_COLOR_CANDLE_BEAR, 0);
   colors[1] = (color)ChartGetInteger(0, CHART_COLOR_CANDLE_BULL, 0);
   colors[2] = (color)ChartGetInteger(0, CHART_COLOR_CHART_LINE, 0);
The array, clearly the sea, is declared before...
 
Alexey Viktorov:
The array, clearly the sea, is announced before...
Thank you.
 
Alexey Viktorov:
   colors[0] = (color)ChartGetInteger(0, CHART_COLOR_CANDLE_BEAR, 0);
   colors[1] = (color)ChartGetInteger(0, CHART_COLOR_CANDLE_BULL, 0);
   colors[2] = (color)ChartGetInteger(0, CHART_COLOR_CHART_LINE, 0);

I still don't understand how to insert these colours. There are examples of colours everywhere:

#property indicator_color1  clrRed,clrBlue,clrGreen,clrYellow,clrMagenta 
If you can, give an example, or put in my example.
Files:
 
Nauris Zukas:

I still don't understand how to insert these colours. There are examples of colours everywhere:

If you can, give an example, or put in my example.
Yes in every colour style there is an example of using other colours. At least in ZZ here.
Документация по MQL5: Пользовательские индикаторы / Стили индикаторов в примерах / DRAW_COLOR_ZIGZAG
Документация по MQL5: Пользовательские индикаторы / Стили индикаторов в примерах / DRAW_COLOR_ZIGZAG
  • www.mql5.com
//|                                            DRAW_COLOR_ZIGZAG.mq5 | //|                        Copyright 2011, MetaQuotes Software Corp. | //|                                             https://www.mql5.com | //| Custom indicator initialization function                         |...
 
Alexey Viktorov:
Yes, every colour style has an example of using other colours. Even in ZZ here.

I looked it up, but I don't understand how to insert them, your colors are in an array but in the example something else.

color colors[]=
  {
   clrRed,clrBlue,clrGreen,clrChocolate,clrMagenta,clrDodgerBlue,clrGoldenrod,
   clrIndigo,clrLightBlue,clrAliceBlue,clrMoccasin,clrWhiteSmoke,clrCyan,clrMediumPurple
  };

I get errors like this.

   colors[0] = (color)ChartGetInteger(0, CHART_COLOR_CANDLE_BEAR, 0);
   colors[1] = (color)ChartGetInteger(0, CHART_COLOR_CANDLE_BULL, 0);
   colors[2] = (color)ChartGetInteger(0, CHART_COLOR_CHART_LINE, 0);
   
   color colors[]=
  {
   colors[0],colors[1],colors[2]
  };
 
Nauris Zukas:

I looked it up, but I don't understand how to insert them, your colors are in an array but in the example something else.

I get errors like this.

I used this array for other purposes, the name of the array is just a simple match with the example in the documentation because it's easy to understand what's stored in the array.

Since I didn't have to deal with such a mess like yours, I have to figure it out for myself first, in order to answer it. And I don't really need it. Exclusively for you, sorry I have no desire and no time. Try to understand arrays, how they are declared, how they are used and other stuff with arrays. What is written in your post shows a complete ignorance of arrays.

Reason: