Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator value to be referred in another indicator

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

    Indicator value to be referred in another indicator

    Hello

    I am trying to refer value of one indicator in another indicator.
    1.If the name of the indicator is "a" (The indicator whose bullish and bearish signal/value is to be referred)
    2.Indicator "a" have bullish and bearish value.(Bullish signal and bearish signal)
    3.I wish to refer this value i.e bullish value of indicator "a" in another indicator.And in the same way also bearish value in another indicator.
    4.How to do this.
    5.Is it possible with coding as
    a.bullish[0] FOR REFERRING BULLISH SIGNAL

    a.bearish[0 FOR REFERRING BEARISH SIGNAL

    Pl correct me if wrong and advise.

    Thanks.

    #2
    Hello profitabletrader306,

    I would recommend naming the indicator class something longer than the letter a.

    However the general syntax in the host script (that calls the hosted script) would be:

    In #region Variables:
    private a myA;

    In OnStateChange() when State is State.DataLoaded:
    myA = a();

    In OnBarUpdate():
    Print(myA.Bullish[0]);


    For an indicator to have a plot you can call by name in a hosted script there must be a public series.
    In the MACD indicator included with NinjaTrader see lines 112 through 117 where a public series is declared, line 56 where the plot is created, and 85 where a value is set for the plot on the current bar.

    Also below are public links to the help guide on AddPlot() and Value/Values.





    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks a lot.

      Comment

      Latest Posts

      Collapse

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