Let me first post the code.
namespace NinjaTrader.NinjaScript.Indicators.TestIndicators { public class ListsAwckardnessIssues : Indicator { private List<int> list00, list01; protected override void OnStateChange() { if (State == State.SetDefaults) { Description = @"dont undestand what wappens"; Name = "ListsAwckardnessIssues"; Calculate = Calculate.OnBarClose; IsOverlay = false; 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; } else if (State == State.Configure) { list00 = new List<int>(); list01 = new List<int>(); } } protected override void OnBarUpdate() { list00.Add(CurrentBar); Print("List of currentbars: List00 "+string.Join(", ",list00)); Print("List of currentbars: List01 "+string.Join(", ",list01)); if (CurrentBar%5==0) { // list01.Clear(); list01 = list00; list00.Clear(); Print(""); Print("List01: "+string.Join(", ",list01)); Print("List00: "+string.Join(", ",list00)); } } } }
and now let me post the results that I expected.
Here is the indeator...
[ATTACH]n1253296[/ATTACH]
Please let me know what Am I doing wrong??
Thank You
FVJ
Comment