I am trying to make this to work without relying on SharpDX libraries for clean and simple notes to display on the chart panel. It seems that I can't make it to display the text messages correctly.
Source Code
public class FixedText : Indicator
{
private SimpleFont fontStyle;
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"FixedText";
Name = "FixedText";
Calculate = Calculate.OnBarClose;
IsOverlay = true;
DisplayInDataBox = false;
DrawOnPricePanel = true;
DrawHorizontalGridLines = false;
DrawVerticalGridLines = false;
PaintPriceMarkers = false;
ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
//Disable this property if your indicator requires custom values that cumulate with each new market data event.
//See Help Guide for additional information.
IsSuspendedWhileInactive = true;
TextLine1 = @"";
TextLine2 = @"";
TextLine3 = @"";
TextLine4 = @"";
TextLine5 = @"";
DrawTextPosition = TextPosition.Center;//TextPosition.BottomLeft;
FontStyle = new Gui.Tools.SimpleFont("Consolas", 18);
FontColor = Brushes.Blue;
BackgroundColor = Brushes.White;
BackgroundColorOpacity = 100;
}
else if (State == State.Configure)
{
Draw.TextFixed(this, "FixedTextIndicator1", TextLine1 + "\n\n\n\n", DrawTextPosition, FontColor, fontStyle, BackgroundColor, BackgroundColor, BackgroundColorOpacity);
Draw.TextFixed(this, "FixedTextIndicator2", TextLine2 + "\n\n\n", DrawTextPosition, FontColor, fontStyle, BackgroundColor, BackgroundColor, BackgroundColorOpacity);
Draw.TextFixed(this, "FixedTextIndicator3", TextLine3 + "\n\n", DrawTextPosition, FontColor, fontStyle, BackgroundColor, BackgroundColor, BackgroundColorOpacity);
Draw.TextFixed(this, "FixedTextIndicator4", TextLine4 + "\n", DrawTextPosition, FontColor, fontStyle, BackgroundColor, BackgroundColor, BackgroundColorOpacity);
Draw.TextFixed(this, "FixedTextIndicator5", TextLine5, DrawTextPosition, FontColor, fontStyle, BackgroundColor, BackgroundColor, BackgroundColorOpacity);
ForceRefresh();
}
}
protected override void OnBarUpdate()
{
}
#region Properties
[NinjaScriptProperty]
[Display(Name="TextLine1", Order=1, GroupName="Parameters")]
public string TextLine1
{ get; set; }
[NinjaScriptProperty]
[Display(Name="TextLine2", Order=2, GroupName="Parameters")]
public string TextLine2
{ get; set; }
[NinjaScriptProperty]
[Display(Name="TextLine3", Order=3, GroupName="Parameters")]
public string TextLine3
{ get; set; }
[NinjaScriptProperty]
[Display(Name="TextLine4", Order=4, GroupName="Parameters")]
public string TextLine4
{ get; set; }
[NinjaScriptProperty]
[Display(Name="TextLine5", Order=5, GroupName="Parameters")]
public string TextLine5
{ get; set; }
[NinjaScriptProperty]
[XmlIgnore]
[Display(Name="DrawTextPosition", Order=10, GroupName="Parameters")]
public TextPosition DrawTextPosition
{ get; set; }
[NinjaScriptProperty]
[Display(Name="FontStyle", Order=15, GroupName="Parameters")]
public SimpleFont FontStyle
{
get { return fontStyle; }
set { fontStyle = value; }
}
[NinjaScriptProperty]
[XmlIgnore]
[Display(Name="FontColor", Order=20, GroupName="Parameters")]
public Brush FontColor
{ get; set; }
[Browsable(false)]
public string FontColorSerializable
{
get { return Serialize.BrushToString(FontColor); }
set { FontColor = Serialize.StringToBrush(value); }
}
[NinjaScriptProperty]
[XmlIgnore]
[Display(Name="BackgroundColor", Order=21, GroupName="Parameters")]
public Brush BackgroundColor
{ get; set; }
[Browsable(false)]
public string BackgroundColorSerializable
{
get { return Serialize.BrushToString(BackgroundColor); }
set { BackgroundColor = Serialize.StringToBrush(value); }
}
[NinjaScriptProperty]
[Range(0, 100)]
[Display(Name="BackgroundColorOpacity", Order=22, GroupName="Parameters")]
public int BackgroundColorOpacity
{ get; set; }
#endregion
}
}


Comment