Error Messages:
- The name 'DashStyleHelper' does not exist in the current context.
- The type or namespace name 'Stroke' does not exist in the namespace 'NinjaTrader.NinjaScript.DrawingTools'.
Ninjascript code:
"
private void DrawTrendlineIfPossible(List<double> trendPoints, string tagPrefix, System.Windows.Media.Brush brush)
{
if (trendPoints.Count >= 2)
{
NinjaTrader.NinjaScript.DrawingTools.Stroke lineStroke = new NinjaTrader.NinjaScript.DrawingTools.Stroke(brush, DashStyles.Solid, 2);
Draw.Line(this, tagPrefix + CurrentBar, false, CurrentBar - trendPoints.Count + 2, trendPoints[trendPoints.Count - 2], CurrentBar, trendPoints[trendPoints.Count - 1], lineStroke);
}
}
"
Previous Attempts to Resolve:
- Tried using SharpDX for rendering, using DashStyles.Solid, and adjusting namespaces.
- Checked NinjaTrader documentation, including Draw.RegressionChannel() and the Stroke class, which still mention DashStyleHelper, but the current version of NinjaTrader does not recognize it.
- Has DashStyleHelper been deprecated or replaced in NinjaTrader version 8.1.3.1?
- Are there any additional namespaces or assembly references required to use Stroke from DrawingTools?
- Could you provide an example of how to properly draw a trendline using a stroke with a solid style in the latest NinjaTrader version?
Goal of the Code: The goal is to draw dynamic trendlines on charts and create alerts when price touches the trendlines. This feature is essential for my strategy, and I need compatibility with current NinjaTrader classes and methods.

Comment