My code looks like this:
region Using declarations using System;
using System.ComponentModel;
using System.Windows.Media;
using NinjaTrader.Cbi;
using NinjaTrader.Gui.Tools;
using NinjaTrader.NinjaScript;
using NinjaTrader.Data;
using NinjaTrader.NinjaScript.Strategies;
using NinjaTrader.NinjaScript.Indicators;
using NinjaTrader.Gui;
#endregion
// Indicator Declaration
[Gui.Design.DisplayName("Custom Stochastic")]
public class CustomStochastic : Indicator
{
private Stochastics stochastics;
protected override void Initialize()
{
// Define the visual elements
Add(new Plot(new Pen(Brushes.Cyan, 1.4), PlotStyle.Line, "%K"));
Add(new Line(Brushes.Red, 80, "Upper1"));
Add(new Line(Brushes.Orange, 70, "Upper2"));
Add(new Line(Brushes.Orange, 30, "Lower1"));
Add(new Line(Brushes.Red, 20, "Lower2"));
stochastics = Stochastics(8, 3, 6);
}
protected override void OnBarUpdate()
{
if (CurrentBar < 1) return;
double K = stochastics.K[0];
double D = stochastics.D[0];
double PrevK = stochastics.K[1];
double PrevD = stochastics.D[1];
// Assign values
Values[0][0] = K;
// Check for crossover
if (PrevK <= PrevD && K > D) // Cross up
{
PlotBrushes[0][0] = Brushes.Cyan;
}
else if (PrevK >= PrevD && K < D) // Cross down
{
PlotBrushes[0][0] = Brushes.DarkViolet;
}
// If it's exactly on the crossover, we color it white
if ((PrevK <= PrevD && K >= D) || (PrevK >= PrevD && K <= D))
{
PlotBrushes[0][0] = Brushes.White;
}
}
region Properties
[Browsable(false)]
public DataSeries K // <----- The error is here
{
get { return Values[0]; }
}
#endregion
}
Error: CS0246 - The type or namespace name 'DataSeries' could not be found.
Could anyone think of why I would be getting this error? Your help would be greatly appreciated.
Thanks in advance!

(Im a noob at coding)
Comment