Please take the color of the plot first:
Color plotColor = Plots[index].Pen.Color;
index = 1 if you want to specify the second-added plot (in the Initialize section)
index = 2 if you want to specify the third-added plot (in the Initialize section)
....
Then input it to the DrawText() function, using the long signature:
DrawText(string tag, bool autoScale, string text, int barsAgo, double y, int yPixelOffset, [B]Color plotColor[/B], Font font, StringAlignment alignment, Color outlineColor, Color areaColor, int areaOpacity)
DrawText("my tag" + CurrentBar, AutoScale, "text to display", 0, High[0], 0, [B]plotColor[/B], ChartControl.Font, StringAlignment.Near, Color.Transparent, Color.Transparent, 0);
Pi
Leave a comment: