Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Want to pass plotbrushes to a class by reference

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Want to pass plotbrushes to a class by reference

    Hi,

    I would like to pass the plotbrushes as well as plot references to a class such that I can have my logic in the class color and paint the values on the chart...

    I cant seem to pass the reference...

    I call
    Code:
     	newSwing.PaintSwingInfo(ref this.PlotBrushes);
    here is the method in my class, which i cant figure out what to write for the variable being passed

    Code:
    		public void PaintSwingInfo(ref Indicator.plo ???????)
    		{
    					//LongReversal0[0] = newSwing.LowOf3Bar - 2* TickSize;
    					//LongReversal1[1] = newSwing.LowOf3Bar - 2* TickSize;
    
    	
    					//p.= Brushes.Green;
    					p.PlotBrushes[0][0] = Brushes.Yellow;
    					p.PlotBrushes[1][1] = Brushes.Green;
    
    		}

    #2
    Hello,

    Thank you for the question.

    You would need to use the BrushSeries[] type, this can be found by typing into the NinjaScript editor PlotBrushes and then hold the mouse over that property. It should show in teal text the Type of the object, in this case its BrushSeries[]

    Here is a simple example of passing the series to a class:

    Code:
    private MyTestClass myTest;
    protected override void OnStateChange()
    {
    	if (State == State.DataLoaded)
    	{
    		myTest = new MyTestClass(PlotBrushes);
    	}
    }
    		
    public class MyTestClass
    {
    	public MyTestClass(BrushSeries[] myBrushes)
    	{
    	}
    			
    }
    I look forward to being of further assistance
    JesseNinjaTrader Customer Service

    Comment


      #3
      I tried your example, but the plotbrushes colors would not be set. There was no compile or syntax error, the code just didnt change the colors.

      Also, could you please also explain how I can pass the reference to set the plot values in the function in the class that receives the reference.


      Thank you for your kind help.

      Comment


        #4
        Hello,

        Thank you for the reply.

        I would be unsure what is not working without seeing the syntax being used currently. I have included an expanded example, if you copy and paste this into an indicator this should produce the expected reuslt of changing the Plot brush from a seperate class.

        If you are having results not aligned with this, please provide the syntax you are using and I could check what the differences are in the approach.

        Code:
        private MyTestClass myTest;
        protected override void OnStateChange()
        {
        	if(State == State.Configure)
        	{
        		AddPlot(Brushes.Red, "Plot0");
        	} 
        	else if (State == State.Historical)
        	{
        		myTest = new MyTestClass(PlotBrushes);
        	}
        }
        
        protected override void OnBarUpdate(){
        	Value[0] = Close[0];
        	myTest.ChangeBrush(Brushes.Blue);	
        }
        
        public class MyTestClass
        {
        	private BrushSeries[] myBrushSeries = null;
        	public MyTestClass(BrushSeries[] myBrushes)
        	{
        			myBrushSeries = myBrushes;
        	}
        	public void ChangeBrush(Brush brush)
        	{
        		myBrushSeries[0][0] = brush;	
        	}
        }
        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Ok, I have 2 questions, to clarify all of this...

          Firstly, if I want to change the plot color to different colors for the two prior dots, it doest work.. here is code:
          Code:
          private MyTestClass myTest;
          protected override void OnStateChange()
          {
          	if(State == State.Configure)
          	{
          		AddPlot(Brushes.Red, "Plot0");
          	} 
          	else if (State == State.Historical)
          	{
          		myTest = new MyTestClass(PlotBrushes);
          	}
          }
          
          protected override void OnBarUpdate(){
          	Value[0] = Close[0];
          	Value[1] = Close[0];
          	Value[2] = Close[0];
          
          	myTest.ChangeBrush();	
          }
          
          public class MyTestClass
          {
          	private BrushSeries[] myBrushSeries = null;
          	public MyTestClass(BrushSeries[] myBrushes)
          	{
          			myBrushSeries = myBrushes;
          	}
          	public void ChangeBrush()
          	{
          		myBrushSeries[0][0] = Brushes.White;	
          		myBrushSeries[0][1] = Brushes.Red;	
          		myBrushSeries[0][2] = Brushes.Blue;
          	}
          }
          Secondly, I would like to change the value of the plot as well as acces the Close[0] and High[1] , Low[0] and TickSize and DrawText. So looking at the code:
          Code:
          private MyTestClass myTest;
          protected override void OnStateChange()
          {
          	if(State == State.Configure)
          	{
          		AddPlot(Brushes.Red, "Plot0");
          	} 
          	else if (State == State.Historical)
          	{
          		myTest = new MyTestClass(PlotBrushes);
          	}
          }
          
          protected override void OnBarUpdate(){
          	//Value[0] = Close[0];
          	myTest.ChangeBrush();	
          }
          
          public class MyTestClass
          {
          	private BrushSeries[] myBrushSeries = null;
          	public MyTestClass(BrushSeries[] myBrushes)
          	{
          		myBrushSeries = myBrushes;
          		// need to add variables and references for accessing Low[x],High[x], Open[x], Close[x], TickSize
          		// lastly would like to access the Draw , so i can draw text values..
          		
          	}
          	public void ChangeBrush()
          	{
          		if (Close[0] > High[1])
          		{
          
          	                Value[0] = Low[0] + 2-TickSize;
          	                Value[1] = Low[0] + 2-TickSize;
          	                Value[2] = Low[0] + 2-TickSize;
          
          			myBrushSeries[0][0] = Brushes.White;	
          			myBrushSeries[0][1] = Brushes.Green;	
          			myBrushSeries[0][2] = Brushes.Yellow;
          			Draw.Text(NinjaScriptBase owner???, "tag1", "Big", 1, High[0])
          		}
          		else
          		{
          			Value[0] = High[0] + 2*TickSize;
          			Value[1] = High[0] + 2*TickSize;
          			Value[2] = High[0] + 2*TickSize;
          
          			myBrushSeries[0][0] = Brushes.Red;	
          			myBrushSeries[0][1] = Brushes.Orange;	
          			myBrushSeries[0][2] = Brushes.Blue;
          		}
          
          	}
          }

          Comment


            #6
            Hello,

            Thank you for the reply.

            Unfortunately what was provided is not able to compile without modification, additionally there are not enough series added in the sample currently to use more than 1 PlotBrushes index. Plot brushes directly reflects the amount of Plots you add, if you do not add 3 plots there would not be 3 index locations.

            Could you provide the entire file for me to see what is currently being used?

            Additionally I would not suggest putting Price logic inside a class you will be accessing, generally a separate class could be used for utilities such as Math or other items where you pass a value in to get a return result. Plotting and accessing Price data should be completed in the OnBarUpdate method in most cases. The extra class you are creating is not inheriting from an Indicator so items like Close, Print, Values, Draw.Text, etc will not be able to be used without a reference to the original indicator.


            Please let me know if I may be of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              Hi, Yes, I think its a good idea for me to make the code, which can compile, so you can show me the best way to implement. I did this below.

              I understand that most times it is preferable to handle all the open[0] and close[0] type logic in the onBarUpdate event, I get that.. However, I have a lot of complex code that I want to hide and tuck away into objects which can be fired from within the OnBarUpdate Event, so I really would like to know how to do it.

              Below is the code, it will compile..

              There is a const called DoInObject, if false it shows the logic firing locally, however if false it will call the method of the instantiated obejct called TickTock() which is where I want that logic to fire.

              Thank you in advance for your patience and help.


              Code:
              #region Using declarations
              using System;
              using System.Collections.Generic;
              using System.ComponentModel;
              using System.ComponentModel.DataAnnotations;
              using System.Linq;
              using System.Text;
              using System.Threading.Tasks;
              using System.Windows;
              using System.Windows.Input;
              using System.Windows.Media;
              using System.Xml.Serialization;
              using NinjaTrader.Cbi;
              using NinjaTrader.Gui;
              using NinjaTrader.Gui.Chart;
              using NinjaTrader.Gui.SuperDom;
              using NinjaTrader.Gui.Tools;
              using NinjaTrader.Data;
              using NinjaTrader.NinjaScript;
              using NinjaTrader.Core.FloatingPoint;
              using NinjaTrader.NinjaScript.DrawingTools;
              #endregion
              
              //This namespace holds Indicators in this folder and is required. Do not change it. 
              namespace NinjaTrader.NinjaScript.Indicators.NewFolder
              {
              	
              		public class MyTestClass
              		{
              			private BrushSeries[] myBrushSeries = null;
              			public MyTestClass(BrushSeries[] myBrushes)
              			{
              					myBrushSeries = myBrushes;
              			}
              			public void TickTock()
              			{
              					
              				// how would I write code here that would allow the logic to work here??????
              				if (Open[0] == Close[0])
              				{
              					InfoDot[0] = Low[0];
              					InfoDot[1] = High[1];
              					InfoDot[2] = Low[2];
              					myBrushSeries[0][0] = Brushes.Red;
              					myBrushSeries[0][1] = Brushes.Green;
              					myBrushSeries[0][2] = Brushes.Red;	
              					Draw.Text(this, "tag1"+CurrentBar, "Doji", 1, High[0] + 3*TickSize);
              				}
              			}
              		}
              	
              	public class BaoTest : Indicator
              	{
              		
              
              		MyTestClass myTest;
              		
              		
              		protected override void OnStateChange()
              		{
              			if (State == State.SetDefaults)
              			{
              				Description									= @"Test Object Concepts";
              				Name										= "BaoTest";
              				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(new Stroke(Brushes.Transparent, 4), PlotStyle.Dot, "InfoDot");
              				
              				myTest = new MyTestClass(PlotBrushes);
              			}
              			else if (State == State.Configure)
              			{
              			}
              		}
              
              		protected override void OnBarUpdate()
              		{
              			const bool DoInObject = false;
              			
              			if (!DoInObject)
              			{
              				if (Open[0] == Close[0])
              				{
              					InfoDot[0] = Low[0];
              					InfoDot[1] = High[1];
              					InfoDot[2] = Low[2];
              					PlotBrushes[0][0] = Brushes.Red;
              					PlotBrushes[0][1] = Brushes.Green;
              					PlotBrushes[0][2] = Brushes.Red;	
              					Draw.Text(this, "tag1"+CurrentBar, "Doji", 1, High[0] + 3*TickSize);
              				}
              			}
              			else
              			{
              				myTest.TickTock();
              			}
              		}
              
              		#region Properties
              
              		[Browsable(false)]
              		[XmlIgnore]
              		public Series<double> InfoDot
              		{
              			get { return Values[0]; }
              		}
              		#endregion
              
              	}
              }
              
              #region NinjaScript generated code. Neither change nor remove.
              
              namespace NinjaTrader.NinjaScript.Indicators
              {
              	public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
              	{
              		private NewFolder.BaoTest[] cacheBaoTest;
              		public NewFolder.BaoTest BaoTest()
              		{
              			return BaoTest(Input);
              		}
              
              		public NewFolder.BaoTest BaoTest(ISeries<double> input)
              		{
              			if (cacheBaoTest != null)
              				for (int idx = 0; idx < cacheBaoTest.Length; idx++)
              					if (cacheBaoTest[idx] != null &&  cacheBaoTest[idx].EqualsInput(input))
              						return cacheBaoTest[idx];
              			return CacheIndicator<NewFolder.BaoTest>(new NewFolder.BaoTest(), input, ref cacheBaoTest);
              		}
              	}
              }
              
              namespace NinjaTrader.NinjaScript.MarketAnalyzerColumns
              {
              	public partial class MarketAnalyzerColumn : MarketAnalyzerColumnBase
              	{
              		public Indicators.NewFolder.BaoTest BaoTest()
              		{
              			return indicator.BaoTest(Input);
              		}
              
              		public Indicators.NewFolder.BaoTest BaoTest(ISeries<double> input )
              		{
              			return indicator.BaoTest(input);
              		}
              	}
              }
              
              namespace NinjaTrader.NinjaScript.Strategies
              {
              	public partial class Strategy : NinjaTrader.Gui.NinjaScript.StrategyRenderBase
              	{
              		public Indicators.NewFolder.BaoTest BaoTest()
              		{
              			return indicator.BaoTest(Input);
              		}
              
              		public Indicators.NewFolder.BaoTest BaoTest(ISeries<double> input )
              		{
              			return indicator.BaoTest(input);
              		}
              	}
              }
              
              #endregion

              Comment


                #8
                Hello,

                If you need the base series, along with custom series in the custom class you could pass their instance where you call the method or in the constructor of the class. NinjaTrader uses standard C# programming language so standard C# structure and logic applies in this case.

                I modified the code provided to show passing instances in the constructor, this would be the exact same process as we went through for passing the BrushSeries to the new class.


                Code:
                namespace NinjaTrader.NinjaScript.Indicators.NewFolder
                {
                		public class MyTestClass
                		{
                			private BrushSeries[] PlotBrushes = null;
                			private ISeries<double> Open;
                			private ISeries<double> Close;
                			private ISeries<double> Low;
                			private ISeries<double> High;
                			private Series<double> InfoDot;
                			
                			public MyTestClass(ISeries<double> open, ISeries<double> close,ISeries<double> low, ISeries<double> high, Series<double> infoDot, BrushSeries[] myBrushes)
                			{
                				PlotBrushes = myBrushes;
                				InfoDot = infoDot;
                				Open = open;
                				Close = close;
                				High = high;
                				Low = low;
                			}
                			
                			public bool TickTock()
                			{
                				if (Open[0] == Close[0])
                				{
                					InfoDot[0] = Low[0];
                					InfoDot[1] = High[1];
                					InfoDot[2] = Low[2];
                					PlotBrushes[0][0] = Brushes.Red;
                					PlotBrushes[0][1] = Brushes.Green;
                					PlotBrushes[0][2] = Brushes.Red;	
                					return true;
                				}
                				return false;
                			}
                		}
                	
                	public class BaoTest : Indicator
                	{
                		MyTestClass myTest;
                		
                		protected override void OnStateChange()
                		{
                			if (State == State.SetDefaults)
                			{
                				Description									= @"Test Object Concepts";
                				Name										= "BaoTest";
                				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(new Stroke(Brushes.Transparent, 4), PlotStyle.Dot, "InfoDot");
                			} 
                			else if(State == State.Historical)
                			{
                				myTest = new MyTestClass(Open, Close, Low, High, InfoDot,PlotBrushes);
                			}
                		}
                
                		protected override void OnBarUpdate()
                		{
                			const bool DoInObject = true;
                			if(CurrentBar < 2) return; // you use [2] BarsAgo in the logic, there is a possibility the script will fail without this check. 
                			if (!DoInObject)
                			{
                				if (Open[0] == Close[0])
                				{
                					InfoDot[0] = Low[0];
                					InfoDot[1] = High[1];
                					InfoDot[2] = Low[2];
                					PlotBrushes[0][0] = Brushes.Red;
                					PlotBrushes[0][1] = Brushes.Green;
                					PlotBrushes[0][2] = Brushes.Red;	
                					Draw.Text(this, "tag1"+CurrentBar, "Doji", 1, High[0] + 3*TickSize);
                				}
                			}
                			else
                			{
                				if(myTest.TickTock()) {
                					Draw.Text(this, "tag1"+CurrentBar, "Doji", 1, High[0] + 3*TickSize);
                				}
                			}
                		}
                
                		#region Properties
                
                		[Browsable(false)]
                		[XmlIgnore]
                		public Series<double> InfoDot
                		{
                			get { return Values[0]; }
                		}
                		#endregion
                	}
                }
                You could really format it anyway you like as long as you are doing something that is C# syntax supported, and so long as you pass an instance of the object you are trying to use. the separate class is not an indicator so it would need to have the object you are using passed into that class before you use it.

                Please let me know if I may be of further assistance.
                JesseNinjaTrader Customer Service

                Comment


                  #9
                  Ok thank you, but how would I do a draw text in the MyTest Class please...

                  Comment


                    #10
                    But how would I do a draw text in the MyTest Class please?

                    Thank you.

                    Comment


                      #11
                      Hello,

                      As noted previously, if you need to access something Indicator related, you would need to pass the instance for whatever you need.

                      In this case, because the Draw is a static class you would not need to pass an instance to draw but the indicator instead. the "this" object is what would need to be passed as an overload.

                      an example could be:

                      public MyTestClass(IndicatorBase myIndi)

                      Then you could access the other items like CurrentBar, or TickSize from the myIndi object you pass.

                      To aid with this question, this site may be helpful in learning standard C# syntax and usages:http://www.techotopia.com/index.php/C_Sharp_Essentials

                      Specifically this page for related content to what you are asking: http://www.techotopia.com/index.php/...ed_Programming

                      NinjaTrader uses standard C# programming language which any knowledge of will be helpful in writing NinjaScript.

                      Please let me know if I may be of further assistance.
                      JesseNinjaTrader Customer Service

                      Comment


                        #12
                        Hi, Ok I have it successfully done. But I have one simple question...
                        I noticed that I was able to use the IndicatorBase to access the High and Low series, is that ok, as opposed to passing the "private ISeries<double> Open, private ISeries<double> Close;" ??

                        Code is below.. (it works).

                        Code:
                        #region Using declarations
                        using System;
                        using System.Collections.Generic;
                        using System.ComponentModel;
                        using System.ComponentModel.DataAnnotations;
                        using System.Linq;
                        using System.Text;
                        using System.Threading.Tasks;
                        using System.Windows;
                        using System.Windows.Input;
                        using System.Windows.Media;
                        using System.Xml.Serialization;
                        using NinjaTrader.Cbi;
                        using NinjaTrader.Gui;
                        using NinjaTrader.Gui.Chart;
                        using NinjaTrader.Gui.SuperDom;
                        using NinjaTrader.Gui.Tools;
                        using NinjaTrader.Data;
                        using NinjaTrader.NinjaScript;
                        using NinjaTrader.Core.FloatingPoint;
                        using NinjaTrader.NinjaScript.DrawingTools;
                        #endregion
                        
                        //This namespace holds Indicators in this folder and is required. Do not change it. 
                        namespace NinjaTrader.NinjaScript.Indicators.NewFolder
                        {
                        	
                        		public class MyTestClass
                        		{
                        			private BrushSeries[] myBrushSeries = null;
                        			private IndicatorBase myIndi = null;
                        			private Series <double> InfoDot;
                        			
                        			public MyTestClass(BrushSeries[] myBrushes, Series<double> infoDot, IndicatorBase myIndi)
                        			{
                        				myBrushSeries = myBrushes;
                        				this.myIndi = myIndi;
                        				this.InfoDot = infoDot;
                        			}
                        			public void TickTock()
                        			{
                        					
                        		
                        			if (myIndi.Open[0] == myIndi.Close[0])
                        	
                        				{
                        					InfoDot[0] = myIndi.Low[0];
                        					InfoDot[1] = myIndi.High[1];
                        					InfoDot[2] = myIndi.Low[2];
                        					myBrushSeries[0][0] = Brushes.Red;
                        					myBrushSeries[0][1] = Brushes.Green;
                        					myBrushSeries[0][2] = Brushes.Red;	
                        					Draw.Text(myIndi, "tag1"+ myIndi.CurrentBar, "Doji", 1, myIndi.High[0] + 3*myIndi.TickSize);
                        
                        				}
                        				
                        			}
                        		}
                        	
                        	public class BaoTest : Indicator
                        	{
                        		
                        
                        		MyTestClass myTest;
                        		
                        		
                        		protected override void OnStateChange()
                        		{
                        			if (State == State.SetDefaults)
                        			{
                        				Description									= @"Test Object Concepts";
                        				Name										= "BaoTest";
                        				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(new Stroke(Brushes.Transparent, 4), PlotStyle.Dot, "InfoDot");
                        				
                        				myTest = new MyTestClass(PlotBrushes, InfoDot, this);
                        			}
                        			else if (State == State.Configure)
                        			{
                        			}
                        		}
                        
                        		protected override void OnBarUpdate()
                        		{
                        			const bool DoInObject = true;
                        			
                        			if (!DoInObject)
                        			{
                        				if (Open[0] == Close[0])
                        				{
                        					InfoDot[0] = Low[0];
                        					InfoDot[1] = High[1];
                        					InfoDot[2] = Low[2];
                        					PlotBrushes[0][0] = Brushes.Red;
                        					PlotBrushes[0][1] = Brushes.Green;
                        					PlotBrushes[0][2] = Brushes.Red;	
                        					Draw.Text(this, "tag1"+CurrentBar, "Doji", 1, High[0] + 3*TickSize);
                        				}
                        			}
                        			else
                        			{
                        				myTest.TickTock();
                        			}
                        		}
                        
                        		#region Properties
                        
                        		[Browsable(false)]
                        		[XmlIgnore]
                        		public Series<double> InfoDot
                        		{
                        			get { return Values[0]; }
                        		}
                        		#endregion
                        
                        	}
                        }
                        
                        #region NinjaScript generated code. Neither change nor remove.
                        
                        namespace NinjaTrader.NinjaScript.Indicators
                        {
                        	public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
                        	{
                        		private NewFolder.BaoTest[] cacheBaoTest;
                        		public NewFolder.BaoTest BaoTest()
                        		{
                        			return BaoTest(Input);
                        		}
                        
                        		public NewFolder.BaoTest BaoTest(ISeries<double> input)
                        		{
                        			if (cacheBaoTest != null)
                        				for (int idx = 0; idx < cacheBaoTest.Length; idx++)
                        					if (cacheBaoTest[idx] != null &&  cacheBaoTest[idx].EqualsInput(input))
                        						return cacheBaoTest[idx];
                        			return CacheIndicator<NewFolder.BaoTest>(new NewFolder.BaoTest(), input, ref cacheBaoTest);
                        		}
                        	}
                        }
                        
                        namespace NinjaTrader.NinjaScript.MarketAnalyzerColumns
                        {
                        	public partial class MarketAnalyzerColumn : MarketAnalyzerColumnBase
                        	{
                        		public Indicators.NewFolder.BaoTest BaoTest()
                        		{
                        			return indicator.BaoTest(Input);
                        		}
                        
                        		public Indicators.NewFolder.BaoTest BaoTest(ISeries<double> input )
                        		{
                        			return indicator.BaoTest(input);
                        		}
                        	}
                        }
                        
                        namespace NinjaTrader.NinjaScript.Strategies
                        {
                        	public partial class Strategy : NinjaTrader.Gui.NinjaScript.StrategyRenderBase
                        	{
                        		public Indicators.NewFolder.BaoTest BaoTest()
                        		{
                        			return indicator.BaoTest(Input);
                        		}
                        
                        		public Indicators.NewFolder.BaoTest BaoTest(ISeries<double> input )
                        		{
                        			return indicator.BaoTest(input);
                        		}
                        	}
                        }
                        
                        #endregion

                        Comment


                          #13
                          Hello,

                          Yes, if you are still getting the same result and are not getting any errors in the Tools -> Output window or Log tab of the control center, it would be successful. The point of the prior examples have been to show that if you need to use some "object" from a indicator, you would need to pass that "object" to the class where you are executing the logic.

                          You are free to form the logic however you want, so in this case if you would rather pass the indicator instance and that object contains all the items you need, you could certainly do that as well.

                          I look forward to being of further assistance.
                          JesseNinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by hazylizard, Today, 08:38 AM
                          1 response
                          8 views
                          0 likes
                          Last Post NinjaTrader_Erick  
                          Started by geddyisodin, Today, 05:20 AM
                          2 responses
                          17 views
                          0 likes
                          Last Post geddyisodin  
                          Started by Max238, Today, 01:28 AM
                          5 responses
                          45 views
                          0 likes
                          Last Post Max238
                          by Max238
                           
                          Started by giulyko00, Yesterday, 12:03 PM
                          3 responses
                          13 views
                          0 likes
                          Last Post NinjaTrader_BrandonH  
                          Started by habeebft, Today, 07:27 AM
                          1 response
                          16 views
                          0 likes
                          Last Post NinjaTrader_ChristopherS  
                          Working...
                          X