The basics of my code are:
namespace NinjaTrader.NinjaScript.Strategies.EvanStrategies
{
public class fading1 : Strategy
{
public NinjaTrader.NinjaScript.Indicators.TrendZigZagUTG4 zig;
else if (State == State.DataLoaded)
{
zig = TrendZigZagUTG4(true, spansize, 3, 10);
}
}
protected override void OnBarUpdate()
{
Print(zig.swings.Count); --- This works fine ----------
foreach(swing b in zig.swings) {Print(b);} --- This throws an error CS0246: The type or namespace name 'swing' could not be found (are you missing a using directive or assembly reference?)
}
The indicator looks like this:
public class TrendZigZagUTG4 : Indicator
{
public int dir, pb1, pb2, pb3;
public double pv1, pv2, pv3;
private double hival, loval, price;
private Brush plotcolor;
private int plotwidth;
private bool drawlines, drawdots;
public List <swing> swings = new List<swing>();
public class swing
{
public int bar { get; set; }
public double price { get; set; }
}
protected override void OnStateChange()
{
Any ideas what's wrong with my code?
Comment