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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      67 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      97 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      53 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      108 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      64 views
      0 likes
      Last Post PaulMohn  
      Working...
      X