I am simply trying to change the text color for each row of a text box when specific code conditions are met. Here is a simplified version of code where only text is displayed:
#region Variables
// Wizard generated variables
// User defined variables
// DrawText and DrawTextFixed code
private Color textColor0 = Color.Blue;
private Color textColor1 = Color.SaddleBrown;
private Color textColor2 = Color.Red;
private Font textFont = new Font("Arial", 8, FontStyle.Bold);
...
protectedoverridevoid OnBarUpdate()
{
ITextFixed text0 = DrawTextFixed("DayType0", "Current Bar is a Buy Day.", TextPosition.Center, textColor0, textFont, Color.ForestGreen, Color.White, 7);
ITextFixed text1 = DrawTextFixed("DayType1", "Current Bar is a Sell Day.", TextPosition.Center, textColor1, textFont, Color.ForestGreen, Color.White, 7);
if (TTTcycle().Day[0] == 1)
{
add row displaying text with text0 color in text box;
}
if (TTTcycle().Day[0] == 2)
{
add row displaying text with text1 color in textbox;
}
}
Perhaps I shouldn't use a text box, and instead use Itext and place each row at specific locations on the y-axis. However, there is still the problem of how to change each row color based on the conditions set in OnBarUpdate. Thanks.
Tony
Comment