This may sound like a simple task however the indicator already is drawing some invisible objects on the screen to get these Dots. So I can't attached it to my panel two because I'm drawn them through a list of a class created and called by the indicator.
So then I went and referenced all my variables to another indicator which I couldn't get to work and make the reference calls due to it saying
indicator.name new reference;
So then I tried to link the list of a class to a strategy. I got that to work but it had a HEART ATTACK when I applied it to my charts.
namespace NinjaTrader.Strategy { /// <summary> /// plots horizons /// </summary> [Description("plots horizons")] public class APAhorizonplots : Strategy { #region Variables Indicator.APAHorizon horizon; public int strength = 4; public int dz = 3; //public List<APAHorizon.confluencetime> Master; #endregion protected override void Initialize() { // Master = new List<APAHorizon.confluencetime>(); horizon = APAHorizon(dz, strength); } protected override void OnStartUp() { horizon.Input = BarsArray[0]; } protected override void OnBarUpdate() { //brings over the list class from the indicator List<APAHorizon.confluencetime> DisplayML = horizon.GetMasterSortedlist(); APAHorizon.confluencetime DisplayMasterPlot = horizon.GetLastMasterSortedlist(); //checks for null if(DisplayMasterPlot == null) { Print("Take Off you hoser"); return; } else { foreach(APAHorizon.confluencetime row in DisplayML) { Print("MasterList: Time "+row.day+" total count : "+row.count); Font labelFont = new Font("Arial", 8.0f, FontStyle.Bold); Color cc = Getconfluencecolor(row.count); DrawDot("futureplot"+row.day, true, row.day, Close[0], cc); DrawText("Date of Instance"+row.day,true, ""+row.day.ToShortDateString(), row.day, 0,0, cc, labelFont ,StringAlignment.Center, Color.Transparent, Color.Transparent,0); } // } } private Color Getconfluencecolor(int count) { switch(count) { case 0: return Color.Blue; case 1: return Color.Orange; case 2: return Color.Red; case 3: return Color.Green; case 4: return Color.Black; } return Color.Turquoise; }
Comment