Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using plots from a seprate indicator (no code access)

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

    Using plots from a seprate indicator (no code access)

    I'm building an indicator (my indicator) that needs to look at another indicator's signals (3rd party indicator) as part of a signal bar criteria. I know that the 3rd party indicator plots their signals, I know their values as well. Can this be done in "my indicator" and not use a ninjatrader strategy to accomplish this. What is the best way to do this. Please include sample code if possible. Thanks in advance!

    #2
    Possibly if you can initialize their indicator in code.

    Code:
    namespace NinjaTrader.NinjaScript.Indicators
    {
        public class MyIndicator : Indicator
        {
            private OtherIndicator Other;
            
            protected override void OnStateChange()
            {
                if (State == State.SetDefaults)
                {
                    Description                                    = @"Enter the description for your new custom Indicator here.";
                    Name                                        = "MyIndicator";
                    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.DataLoaded)
                {
                    Other = OtherIndicator();
                }
            }
    
            protected override void OnBarUpdate()
            {
                double otherData = Other[0];
                
                // Do something with otherData
            }
        }
    }​

    Comment


      #3
      Hello ekansbull,

      Thank you for your post.

      zundradaniel is correct. This is basically how you can reference another indicator in code. More specific code can't be provided since the indicator you want to reference is closed-source.

      If you're not able to figure it out, we recommend reaching out to the developer for assistance on how to reference their indicator from within your own script.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      66 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      149 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      99 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      286 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X