Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ChartControl visibility / accessibility

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

    ChartControl visibility / accessibility

    Hi There

    I have an indicator which is calculating data from another indicator.
    This other indicator may be one of those present on the chart.

    To get a list of theses available indicators, I need to write a TypeConverter listing all active indicator.

    However, I'm facing a problem due to the fact that ChartControl is not accessible at this moment:

    Code:
    namespace NinjaTrader.NinjaScript.Indicators
    {
    
        public class myIndicator : Indicator
        {
            protected override void OnStateChange()
            {
                //...
    ​
            }
    
            protected override void OnBarUpdate()
            {
                //...
            }
    
            #region Properties
    
            [TypeConverter(typeof(NinjaTrader.NinjaScript.IndicatorListConverter))]
            public string IndicatorName  
             { get; set; }    
    
            #endregion
        }
    
        public class IndicatorListConverter : StringConverter
        {
            public override StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
            {
                List<string> values = new List<string>();
                if (ChartControl != null && ChartControl.Indicators != null)
                    lock (ChartControl.Indicators)
                        values = ChartControl.Indicators.Select(i => i.Name).ToList();
    
                return new StandardValuesCollection(values);
            }
        ...
        }    
    }
    Error is: ChartControl is used as a type but is used as a variable

    Is there any function to get a reference on the actual ChartControl ?

    #2
    Hello Philippe56140,

    Thanks for your post.

    We are currently looking into this matter and will get back to you as soon as more information is available on this topic.

    I look forward to assisting further.​
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Hello Philippe56140,

      Thanks for your patience.

      There is no supported way to list the chart's indicators, however, this could be accomplished with unsupported code.

      Please see the example scripts shared by my colleague Chelsea on the forum threads linked below for an example of how this could be done through unsupported code.

      ListChartsIndicatorsExample: https://ninjatrader.com/support/foru...tor#post717883

      SampleListIndicators: https://ninjatrader.com/support/foru...nce#post687943

      Let me know if I may further assist you.
      <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      589 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      342 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      555 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      552 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X