Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Mode from a Series double

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

    #31
    Hello PaulMohn,

    If the behavior is not what you expect use prints to debug and understand the behavior.

    Your question is why is the condition evaluating as true?

    if (listOfSeriesValues != null
    && listOfSeriesValues.Count() > 0
    && listOfSeriesValues.Count() <= BarsBack)

    Print the values of the condition
    if (listOfSeriesValues != null)
    {
    Print(string.Format("{0} | listOfSeriesValues.Count(): {1} > 0 && listOfSeriesValues.Count(): {1} <= BarsBack: {2}", Time[0], listOfSeriesValues.Count(), BarsBack));
    }
    else
    {
    Print(string.Format("{0} | listOfSeriesValues is null", Time[0]));
    }

    Print within the condition as well to confirm.
    if (listOfSeriesValues != null
    && listOfSeriesValues.Count() > 0
    && listOfSeriesValues.Count() <= BarsBack)
    {
    Print(string.Format("{0} | condition is true", Time[0]));
    }


    It would be expected that once the count is greater than BarsBack that the action block code would stop being run.

    Or is your question why is the foreach loop looping through each item instead of through a specific range the way a for loop would?
    Last edited by NinjaTrader_ChelseaB; 03-08-2022, 08:39 AM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #32
      Thanks Chelsea for the tips. The prints are ok.

      About your suggestion of using a for loop instead of a foreach loop to get a specific range, I don't know how to specify the range in the condition of the for loop to keep the link to the list with the dictionary and the counts.ContainsKey() method.
      If I use a for loop I can't specify the 'in' listOfSeriesValues, I can only specify the condition upper limit as element < BarsBack.

      I searched for using for loop with a dictionary and found that only but it does not make sense
      I generally use a foreach loop to iterate through Dictionary. Dictionary&lt;string, string&gt; dictSummary = new Dictionary&lt;string, string&gt;(); In this case I want to trim the entries of white


      How would you use the for loop with the dictionary and ContainsKey() method? Thanks!

      Comment


        #33
        Hello PaulMohn,

        If I had a dictionary that contained keys I would use .ContainsKey() to check if that key exists in the dictionary. Perhaps I want to know one exists to update that element instead, or if it does not exist add a new element. Perhaps the loop would be over a few keys I want to check if they are in the dictionary.

        Keep in mind you are asking educational C# questions about how to program in C#. It may be beneficial to learn C# first if you are planning to do this kind of advanced logic.

        Below is a publicly available link to an educational site on for loops.



        Chelsea B.NinjaTrader Customer Service

        Comment


          #34
          Thanks Chelsea for the for loop with examples reference page.
          I got some new valuable insights from the info examples but they were not directly usable for the BarsBack and Dictionary needs.

          GetRange(), Dictionary prior missing Knowledge

          Part 76 Working with generic list class and ranges in c#
          C# List GetRange()

          List<T>.GetRange(Int32, Int32) Method

          Part 81 When to use a dictionary over list in c#

          Stop a loop after a certain amount of iterations, instead of when a max value is met

          How to use ranges with List in C#?

          How can I find the last element in a List<>?

          So far I got to this point in solving the BarsBack problem
          (using GetRange(), starting from 0 up to BarsBack value)
          PHP Code:
                    protected override void OnBarUpdate()
                    {
          
                         Rng0Rng1[Rng0Index] = Rng0[Rng0Index] - Rng1[Rng1Index];
          
                         listOfSeriesValues.Add(Rng0Rng1[0]);
                         listOfSeriesValuesBarsBack = listOfSeriesValues.GetRange(0, BarsBack);
          
                         if (listOfSeriesValuesBarsBack != null && listOfSeriesValuesBarsBack.Count() > 0)
                         {
                            for (int element = 0; element < listOfSeriesValuesBarsBack.Count(); element++)
                            {
                               Print(listOfSeriesValuesBarsBack[element]);
                            }
                         } 
          
          Which throws this Log tab error/prints error
          Indicator 'Testa': Error on calling 'OnBarUpdate' method on bar 21: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
          (using GetRange(), starting from the latest value (.Count() - Barsback up to latest value (.Count())) )
          PHP Code:
                    protected override void OnBarUpdate()
                    {
          
                         Rng0Rng1[Rng0Index] = Rng0[Rng0Index] - Rng1[Rng1Index];
          
                         listOfSeriesValues.Add(Rng0Rng1[0]);
                         listOfSeriesValuesBarsBack = listOfSeriesValues.GetRange(listOfSeriesValuesBarsBack.Count() - BarsBack, listOfSeriesValuesBarsBack.Count());
          
                         if (listOfSeriesValuesBarsBack != null && listOfSeriesValuesBarsBack.Count() > 0)
                         {
                            for (int element = 0; element < listOfSeriesValuesBarsBack.Count(); element++)
                            {
                               Print(listOfSeriesValuesBarsBack[element]);
                            }
                         } 
          
          Which throws this Log tab error/prints error
          Indicator 'Testa': Error on calling 'OnBarUpdate' method on bar 21: You are accessing an index with a value that is invalid since it is out-of-range. I.E. accessing a series [barsAgo] with a value of 5 when there are only 4 bars on the chart.

          Whole reduced script
          PHP Code:
          namespace NinjaTrader.NinjaScript.Indicators
          {
               private Series<double> Rng0;
               private Series<double> Rng1;
          
               private Series<double> Rng0Rng1;
          
               private List<double> listOfSeriesValues;
               private List<double> listOfSeriesValuesBarsBack;
          
          
               public class Testa : Indicator
               {
                    protected override void OnStateChange()
                    {
                         if (State == State.SetDefaults)
                         {
                              BarsBack = 20;
                              Rng0Index = 0;
                              Rng1Index = 0;
                    }
                    else if (State == State.Configure)
                    {
                    }
                    else if (State == State.DataLoaded)
                    {
                              Rng0= new Series<double>(this, MaximumBarsLookBack.Infinite);
                              Rng1= new Series<double>(this, MaximumBarsLookBack.Infinite);
          
                              listOfSeriesValues = new List<double>();
                              listOfSeriesValuesBarsBack = new List<double>();
                    }
          
          
                    protected override void OnBarUpdate()
                    {
          
                         Rng0Rng1[Rng0Index] = Rng0[Rng0Index] - Rng1[Rng1Index];
          
                         listOfSeriesValues.Add(Rng0Rng1[0]);
                         listOfSeriesValuesBarsBack = listOfSeriesValues.GetRange(listOfSeriesValuesBars Back.Count() - BarsBack, listOfSeriesValuesBarsBack.Count());
          
                         if (listOfSeriesValuesBarsBack != null && listOfSeriesValuesBarsBack.Count() > 0)
                         {
                            for (int element = 0; element < listOfSeriesValuesBarsBack.Count(); element++)
                            {
                               Print(listOfSeriesValuesBarsBack[element]);
                            }
                         }
              } 
          

          I found a similar thread for error but I'm not sure how to apply it for my case
          Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.

          ​​​​What're the out of range errors pointing at? Thanks!
          Last edited by PaulMohn; 03-09-2022, 11:27 AM.

          Comment


            #35
            Hello PaulMohn,

            So you are trying to make a copy of your list with a specific range of elements from that list?



            What is the list.Count()?

            What is the value of the start point index? (This was 0, but was changed to listOfSeriesValuesBarsBack.Count() - BarsBack)

            What is the value of BarsBack when used for the count parameter?
            Chelsea B.NinjaTrader Customer Service

            Comment


              #36
              Thanks Chelsea for the leading questions.

              I'm familiar now with the List<T>.GetRange(Int32, Int32) Method

              What is the list.Count()?
              I'm not sure. From the printed output from the correction in post #29 it seems more than 800K

              Click image for larger version  Name:	count.png Views:	0 Size:	125.0 KB ID:	1193010


              What is the value of the start point index? (This was 0, but was changed to listOfSeriesValuesBarsBack.Count() - BarsBack)
              I think it is 805,323 - 20 = 805,303

              What is the value of BarsBack when used for the count parameter?
              I corrected the reduced script in last post to used value = 20

              Thanks!


              I've just tried printing

              PHP Code:
              listOfSeriesValues.Add(Rng0Rng1[0]);
              listOfSeriesValuesBarsBack = listOfSeriesValues.GetRange(0, BarsBack);
              
              Print(listOfSeriesValuesBarsBack.Count() - BarsBack); 
              
              But it throws this
              Indicator 'Testa': Error on calling 'OnBarUpdate' method on bar 21: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.

              I also tried printing
              PHP Code:
              listOfSeriesValues.Add(Rng0Rng1[0]);
              listOfSeriesValuesBarsBack = listOfSeriesValues.GetRange(0, BarsBack);
              
              Print(listOfSeriesValues.Count() - BarsBack); 
              
              But it throws this
              Indicator 'Testa': Error on calling 'OnBarUpdate' method on bar 21: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
              Last edited by PaulMohn; 03-09-2022, 11:48 AM.

              Comment


                #37
                Hello PaulMohn,

                Remove all of the other prints.

                Print the Time[0], print list Count(), print BarsBack separately. Include labels in the prints!!! (very important). Print these above (before) the line causing the error, not after as the code won't be reached once the error is hit.

                Print(string.Format("{0} | listOfSeriesValues.Count(): {1} - BarsBack: {2} = {3}", Time[0], listOfSeriesValues.Count(), BarsBack, (listOfSeriesValues.Count() - BarsBack) ));

                listOfSeriesValuesBarsBack = listOfSeriesValues.GetRange(0, BarsBack);

                Include the output saved to a text file with your reply.
                Last edited by NinjaTrader_ChelseaB; 03-09-2022, 02:32 PM.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #38
                  From
                  PHP Code:
                  listOfSeriesValues.Add(Rng0Rng1[0]);
                  // listOfSeriesValuesBarsBack = listOfSeriesValues.GetRange(0, BarsBack);
                  
                  // Print(listOfSeriesValues.Count() - BarsBack);
                  
                  Print(string.Format("{0} | listOfSeriesValuesBarsBack.Count(): {1} - BarsBack: {2} = {3}", Time[0], listOfSeriesValuesBarsBack.Count(), BarsBack, (listOfSeriesValuesBarsBack.Count() - BarsBack) ));
                  
                  listOfSeriesValuesBarsBack = listOfSeriesValues.GetRange(0, BarsBack); 
                  
                  I get
                  04/03/2022 00:22:00 | listOfSeriesValuesBarsBack.Count(): 0 - BarsBack: 20 = -20
                  Indicator 'Testa': Error on calling 'OnBarUpdate' method on bar 21: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
                  Strange it seems the prints are saying
                  listOfSeriesValuesBarsBack.Count() = 0
                  BarsBack = 20
                  listOfSeriesValuesBarsBack.Count() - BarsBack = -20

                  Why is listOfSeriesValuesBarsBack.Count() = 0 ?

                  I'm getting this when trying right click > Full Text from the output window
                  Click image for larger version  Name:	error.png Views:	0 Size:	7.2 KB ID:	1193024


                  I just tried
                  PHP Code:
                  listOfSeriesValues.Add(Rng0Rng1[0]);
                  // listOfSeriesValuesBarsBack = listOfSeriesValues.GetRange(0, BarsBack);
                  
                  // Print(listOfSeriesValues.Count() - BarsBack);
                  
                  Print(string.Format("{0} | listOfSeriesValuesBarsBack.Count(): {1} - BarsBack: {2} = {3} | listOfSeriesValues.Add(Rng0Rng1[0]): {4} ", Time[0], listOfSeriesValuesBarsBack.Count(), BarsBack, (listOfSeriesValuesBarsBack.Count() - BarsBack), listOfSeriesValues.Add(Rng0Rng1[0]) ));
                  
                  listOfSeriesValuesBarsBack = listOfSeriesValues.GetRange(0, BarsBack); 
                  
                  But I'm getting those errors
                  NinjaScript File Error Code Line Column
                  Testa.cs The best overloaded method match for 'string.Format(string, params object[])' has some invalid arguments CS1502 1433 10
                  NinjaScript File Error Code Line Column
                  Testa.cs Argument 6: cannot convert from 'void' to 'object' CS1503 1433 254
                  Last edited by PaulMohn; 03-09-2022, 12:28 PM.

                  Comment


                    #39
                    Hello PaulMohn,

                    May I confirm this code is being run after there are 20 bars processed so that there are 20 elements added to the listOfSeriesValues list?

                    I see I copied your wrong variable.

                    The print should be:

                    Print(string.Format("{0} | listOfSeriesValues.Count(): {1} - BarsBack: {2} = {3}", Time[0], listOfSeriesValues.Count(), BarsBack, (listOfSeriesValues.Count() - BarsBack) ));
                    Last edited by NinjaTrader_ChelseaB; 03-09-2022, 12:33 PM.
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #40
                      I have the BarsBack as this in State.SetDefaults and the CurrentBar as this in OnBarUpdate()
                      PHP Code:
                       protected override void OnStateChange()
                                {
                                     if (State == State.SetDefaults)
                                     {
                                          BarsBack = 20;
                      
                      
                      protected override void OnBarUpdate()
                      {
                           if(CurrentBar <= BarsBack)
                           {
                                return;
                           } 
                      


                      from
                      PHP Code:
                      listOfSeriesValues.Add(Rng0Rng1[0]);
                      // listOfSeriesValuesBarsBack = listOfSeriesValues.GetRange(0, BarsBack);
                      
                      // Print(listOfSeriesValues.Count() - BarsBack);
                      
                      Print(string.Format("{0} | listOfSeriesValuesBarsBack.Count(): {1} - BarsBack: {2} = {3} | listOfSeriesValues.Count() ): {4} ", Time[0], listOfSeriesValuesBarsBack.Count(), BarsBack, (listOfSeriesValuesBarsBack.Count() - BarsBack), listOfSeriesValues.Count() ));
                      
                      listOfSeriesValuesBarsBack = listOfSeriesValues.GetRange(0, BarsBack); 
                      
                      I get
                      04/03/2022 00:22:00 | listOfSeriesValuesBarsBack.Count(): 0 - BarsBack: 20 = -20 | listOfSeriesValues.Count() ): 1
                      Indicator 'Testa': Error on calling 'OnBarUpdate' method on bar 21: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.

                      Comment


                        #41
                        Hello PaulMohn,

                        Your print is printing listOfSeriesValuesBarsBack (at my erroneous suggestion) and not listOfSeriesValues.Count().

                        See the corrected print in post #39.

                        What is the value of CurrentBar printed one line above the other print?

                        Can you provide an export of a reduced copy of this that only includes this code?

                        To export a NinjaTrader 8 NinjaScript so this can be shared and imported by the recipient do the following:
                        1. Click Tools -> Export -> NinjaScript...
                        2. Click the 'add' link -> check the box(es) for the script(s) and reference(s) you want to include
                        3. Click the 'Export' button
                        4. Enter a unique name for the file in the value for 'File name:'
                        5. Choose a save location -> click Save
                        6. Click OK to clear the export location message
                        By default your exported file will be in the following location:
                        • (My) Documents/NinjaTrader 8/bin/Custom/ExportNinjaScript/<export_file_name.zip>
                        Below is a link to the help guide on Exporting NinjaScripts.
                        http://ninjatrader.com/support/helpG...-us/export.htm

                        Once exported, please attach the file as an attachment to your reply.
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #42
                          I get 21 for CurrentBar
                          PHP Code:
                          listOfSeriesValues.Add(Rng0Rng1[0]);
                          // listOfSeriesValuesBarsBack = listOfSeriesValues.GetRange(0, BarsBack);
                          
                          // Print(listOfSeriesValues.Count() - BarsBack);
                          
                          Print("CurrentBar : " + CurrentBar);
                          Print(string.Format("{0} | listOfSeriesValuesBarsBack.Count(): {1} - BarsBack: {2} = {3} | listOfSeriesValues.Count() ): {4} ", Time[0], listOfSeriesValuesBarsBack.Count(), BarsBack, (listOfSeriesValuesBarsBack.Count() - BarsBack), listOfSeriesValues.Count() ));
                          
                          listOfSeriesValuesBarsBack = listOfSeriesValues.GetRange(0, BarsBack); 
                          
                          Get
                          CurrentBar : 21
                          04/03/2022 00:22:00 | listOfSeriesValuesBarsBack.Count(): 0 - BarsBack: 20 = -20 | listOfSeriesValues.Count() ): 1
                          Indicator 'Testa': Error on calling 'OnBarUpdate' method on bar 21: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
                          I'll see how to prepare the script export next.

                          Comment


                            #43
                            Hello PaulMohn,

                            Is listOfSeriesValues.Add(Rng0Rng1[0]); being added before or after bar 20?

                            Do you need to wait for bar 40? This would wait 20 bars for the values to start being assigned. And another 20 bars so 20 bars have been assigned.

                            Should this be assigned on every bar, before the check for currentbar?

                            if (CurrentBar < 1)
                            return;

                            Rng0Rng1[Rng0Index] = Rng0[Rng0Index] - Rng1[Rng1Index];

                            listOfSeriesValues.Add(Rng0Rng1[0]);

                            if (CurrentBar < 21)
                            return;

                            Print(string.Format("{0} | CurrentBar: {1}, listOfSeriesValues.Count(): {2}", Time[0], CurrentBar, listOfSeriesValues.Count()));
                            Last edited by NinjaTrader_ChelseaB; 03-09-2022, 03:11 PM.
                            Chelsea B.NinjaTrader Customer Service

                            Comment


                              #44
                              I've remove the non essential (but tell me if it needs more) and exported with no compile error
                              Attached Files

                              Comment


                                #45
                                Do you mean have 2 CurrentBar checks as this (in my reduced code)

                                PHP 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;
                                
                                using System.Text.RegularExpressions;
                                #endregion
                                
                                //This namespace holds Indicators in this folder and is required. Do not change it.
                                namespace NinjaTrader.NinjaScript.Indicators
                                {
                                  public class Testa1 : Indicator
                                  {
                                
                                    private Series<double> varO;
                                    private Series<double> varH;
                                    private Series<double> varL;
                                    private Series<double> varC;
                                
                                
                                    private Series<double> Rng0;
                                    private Series<double> Rng1;
                                
                                    private Series<double> Rng0Rng1;
                                
                                    private List<double> listOfSeriesValues;
                                    private List<double> listOfSeriesValuesBarsBack;
                                
                                
                                
                                    protected override void OnStateChange()
                                    {
                                      if (State == State.SetDefaults)
                                      {
                                        Description                   = @"Enter the description for your new custom Indicator here.";
                                        Name                     = "Testa1";
                                        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;
                                        BarsBack                 = 20;
                                        Rng0Index               = 0;
                                        Rng1Index             = 0;
                                
                                      }
                                      else if (State == State.Configure)
                                      {
                                      }
                                      else if (State == State.DataLoaded)
                                      {
                                        varO = new Series<double>(this, MaximumBarsLookBack.Infinite);
                                        varH = new Series<double>(this, MaximumBarsLookBack.Infinite);
                                        varL = new Series<double>(this, MaximumBarsLookBack.Infinite);
                                        varC = new Series<double>(this, MaximumBarsLookBack.Infinite);
                                
                                        Rng0Rng1 = new Series<double>(this, MaximumBarsLookBack.Infinite);
                                
                                        Rng0 = new Series<double>(this, MaximumBarsLookBack.Infinite);
                                        Rng1 = new Series<double>(this, MaximumBarsLookBack.Infinite);
                                
                                        listOfSeriesValues = new List<double>();
                                        listOfSeriesValuesBarsBack = new List<double>();
                                      }
                                    }
                                
                                
                                
                                
                                    protected override void OnBarUpdate()
                                    {  
                                      if (CurrentBar < 1)
                                        return;
                                
                                
                                
                                  varO[0] = Open[0];
                                      varH[0] = High[0];
                                      varL[0] = Low[0];
                                      varC[0] = Close[0];    
                                
                                
                                      // the logic for Countif() etc.    
                                
                                
                                      Rng0Rng1[Rng0Index] = Rng0[Rng0Index] - Rng1[Rng1Index];
                                
                                
                                      listOfSeriesValues.Add(Rng0Rng1[0]);
                                //       listOfSeriesValuesBarsBack = listOfSeriesValues.GetRange(0, BarsBack);
                                
                                //       Print(listOfSeriesValues.Count() - BarsBack);
                                
                                
                                      if(CurrentBar < BarsBack)
                                      {
                                        return;
                                      }
                                
                                      Print("CurrentBar : " + CurrentBar);
                                      Print(string.Format("{0} | listOfSeriesValuesBarsBack.Count(): {1} - BarsBack: {2} = {3} | listOfSeriesValues.Count() ): {4} ", Time[0], listOfSeriesValuesBarsBack.Count(), BarsBack, (listOfSeriesValuesBarsBack.Count() - BarsBack), listOfSeriesValues.Count() ));
                                
                                      listOfSeriesValuesBarsBack = listOfSeriesValues.GetRange(0, BarsBack);
                                
                                
                                    }
                                
                                    #region Properties
                                    [Range(1, int.MaxValue), NinjaScriptProperty]
                                    [Display(ResourceType = typeof(Custom.Resource), Name = "BarsBack", GroupName = "Number of Bars for Stats", Order = 0)]
                                    public int BarsBack
                                    { get; set; }
                                
                                
                                
                                
                                    [Range(0, int.MaxValue), NinjaScriptProperty]
                                    [Display(ResourceType = typeof(Custom.Resource), Name = "Rng0Index", GroupName = "Range Bottom Index", Order = 3)]
                                    public int Rng0Index
                                    { get; set; }
                                
                                
                                
                                    [Range(0, int.MaxValue), NinjaScriptProperty]
                                    [Display(ResourceType = typeof(Custom.Resource), Name = "Rng1Index", GroupName = "Range Bottom Index", Order = 4)]
                                    public int Rng1Index
                                    { get; set; }
                                    #endregion
                                  }
                                }
                                
                                #region NinjaScript generated code. Neither change nor remove.
                                
                                namespace NinjaTrader.NinjaScript.Indicators
                                {
                                  public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
                                  {
                                    private Testa1[] cacheTesta1;
                                    public Testa1 Testa1(int barsBack, int rng0Index, int rng1Index)
                                    {
                                      return Testa1(Input, barsBack, rng0Index, rng1Index);
                                    }
                                
                                    public Testa1 Testa1(ISeries<double> input, int barsBack, int rng0Index, int rng1Index)
                                    {
                                      if (cacheTesta1 != null)
                                        for (int idx = 0; idx < cacheTesta1.Length; idx++)
                                          if (cacheTesta1[idx] != null && cacheTesta1[idx].BarsBack == barsBack && cacheTesta1[idx].Rng0Index == rng0Index && cacheTesta1[idx].Rng1Index == rng1Index && cacheTesta1[idx].EqualsInput(input))
                                            return cacheTesta1[idx];
                                      return CacheIndicator<Testa1>(new Testa1(){ BarsBack = barsBack, Rng0Index = rng0Index, Rng1Index = rng1Index }, input, ref cacheTesta1);
                                    }
                                  }
                                }
                                
                                namespace NinjaTrader.NinjaScript.MarketAnalyzerColumns
                                {
                                  public partial class MarketAnalyzerColumn : MarketAnalyzerColumnBase
                                  {
                                    public Indicators.Testa1 Testa1(int barsBack, int rng0Index, int rng1Index)
                                    {
                                      return indicator.Testa1(Input, barsBack, rng0Index, rng1Index);
                                    }
                                
                                    public Indicators.Testa1 Testa1(ISeries<double> input , int barsBack, int rng0Index, int rng1Index)
                                    {
                                      return indicator.Testa1(input, barsBack, rng0Index, rng1Index);
                                    }
                                  }
                                }
                                
                                namespace NinjaTrader.NinjaScript.Strategies
                                {
                                  public partial class Strategy : NinjaTrader.Gui.NinjaScript.StrategyRenderBase
                                  {
                                    public Indicators.Testa1 Testa1(int barsBack, int rng0Index, int rng1Index)
                                    {
                                      return indicator.Testa1(Input, barsBack, rng0Index, rng1Index);
                                    }
                                
                                    public Indicators.Testa1 Testa1(ISeries<double> input , int barsBack, int rng0Index, int rng1Index)
                                    {
                                      return indicator.Testa1(input, barsBack, rng0Index, rng1Index);
                                    }
                                  }
                                }
                                
                                #endregion 
                                

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                626 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                359 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by Mindset, 02-09-2026, 11:44 AM
                                0 responses
                                105 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                                0 responses
                                562 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by RFrosty, 01-28-2026, 06:49 PM
                                0 responses
                                567 views
                                1 like
                                Last Post RFrosty
                                by RFrosty
                                 
                                Working...
                                X