I can create the indicator and it will chart, but then said value will not appear in my strategy?
Regards,
Andrew
This is the code that will chart but not translate (ignore the manual SMA, I am checking my math value by value):
Indicator (name is VolumePlots):
Add(PeriodType.Day, 1); BarsRequired = 20; Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Line, "plotIntradayVolume")); Add(new Plot(Color.FromKnownColor(KnownColor.Green), PlotStyle.Line, "plotTenDayAvgVol")); } protected override void OnBarUpdate() { if (CurrentBars[0] < BarsRequired || CurrentBars[1] < BarsRequired) return; intradayVolume = Volumes[1][0]; tenDayAvgVol = (Volumes[1][1] + Volumes[1][2] + Volumes[1][3] + Volumes[1][4] + Volumes[1][5] + Volumes[1][6] + Volumes[1][7] + Volumes[1][8] + Volumes[1][9] + Volumes[1][10])/10; plotIntradayVolume.Set(intradayVolume); plotTenDayAvgVol.Set(tenDayAvgVol); } #region Properties public DataSeries plotIntradayVolume { get { return Values[0]; } } public DataSeries plotTenDayAvgVol { get { return Values[1]; } }
cumVolume = VolumePlots().intradayVolume; Print(cumVolume); avgVolume = VolumePlots().tenDayAvgVol; Print (avgVolume);
Any help appreciated,
Regards,
Andrew
Comment