I made something but it doesn't work well.
Here is my code.
...
protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
{
base.OnRender(chartControl, chartScale);
if (!IsInHitTest)
{
SharpDX.Direct2D1.Brush color;
color = Brushes.White.ToDxBrush(RenderTarget);
NinjaTrader.Gui.Tools.SimpleFont simpleFont = new NinjaTrader.Gui.Tools.SimpleFont("Arial", 16);
SharpDX.DirectWrite.TextFormat textFormat = simpleFont.ToDirectWriteTextFormat();
string msg = trendStr;
SharpDX.DirectWrite.TextLayout textLayout = new SharpDX.DirectWrite.TextLayout(NinjaTrader.Core.Globals.DirectWriteFactory, msg, textFormat, 400, textFormat.FontSize);
SharpDX.Vector2 lowerTextPoint = new SharpDX.Vector2(ChartPanel.W-textLayout.Metrics.Width, ChartPanel.H-textLayout.Metrics.Height);
RenderTarget.DrawTextLayout(lowerTextPoint, textLayout, color, SharpDX.Direct2D1.DrawTextOptions.NoSnap);
color.Dispose();
textFormat.Dispose();
textLayout.Dispose();
}
}
...
Do I need to make any specific settings for these two cases?
If not, what are some solutions?
Thanks.

Comment