when a specific signal occure, I like to safe a lot of Data of this point. But the Problem is, that I´m not able to backtest the strategy, because of the historical Data i would need, I gess, it´s safed, I rather would use a DataSeries.
My question is to I have to set public properties for each Data so that i can use it for plotting or to show it in the DataBox and for backtests?
In the following a little Indicator to show what i mean.
thanks for your help in advance.
public class SeriesCombinedWithList : Indicator
{
public MyHigh MyHigh;
public List<MyHigh> myHighs;
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Enter the description for your new custom Indicator here.";
Name = "SeriesCombinedWithList";
Calculate = Calculate.OnBarClose;
IsOverlay = true;
DisplayInDataBox = true;
DrawOnPricePanel = true;
DrawHorizontalGridLines = true;
DrawVerticalGridLines = true;
PaintPriceMarkers = true;
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;
AddPlot(Brushes.Orange, "MaxHigh");
}
else if (State == State.Configure)
{
myHighs = new List<MyHigh>();
}
}
protected override void OnBarUpdate()
{
if (CurrentBar < 14)
return;
if(High[0] > MAX(High, 14)[1])
{
MyHigh = new MyHigh(High[0], Low[0], CurrentBar);
myHighs.Add(MyHigh);
}
}
#region Properties
[Browsable(false)]
[XmlIgnore]
public Series<double> MaxHigh
{
get { return Values[0]; }
}
#endregion
}
public class MyHigh
{
public double High { get; set; }
public double Low { get; set; }
public double Id { get; set; }
public MyHigh(double high, double low, double id)
{
High = high;
Low = low;
Id = id;
}
}
}

Comment