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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      601 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      347 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
      559 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      558 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X