Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using Plot data from Original Class Instance

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

    Using Plot data from Original Class Instance

    Hello!


    I would like to create few indicators (IndicatorA , IndicatorB, etc) based on Plot's data , calculated in one base Indicator and use all Indicators on the same chart.

    Let's say for example that I would use MACD as my Base Indicator and use Avg values in IndicatorA.

    I could use in IndicatorA formula MACD(12,26,9).Avg[0] to reach element 0 in DataSeries containing historical values for Plot Avg.
    In IndicatorA I'll create PlotA.

    In IndicatorB I will use formula to reach PlotA data as IndicatorA.PlotA[0].

    In my understanding all these calls will create few instances of Classes defining MACD and IndicatorA and forcing system to use extra memory and processor power, recalculating the same values few times.

    Do you have way to access data created by original Class Instance(MACD) used to plot actual MACD Indicator on chart?

    Thanks
    YB

    #2
    Unfortunately not. These will be separate instances.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Maybe there is some way to expose IDataSeries object representing The Plot globally?

      Thanks
      Yuliy

      Comment


        #4
        Yuliy,

        Unfortunately this is not supported. I suggest merging your calculations into one script if feasible for what you are trying to do and use multiple plots in the same script.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Josh,

          In this case, could I place Plots from one script on few Panels.

          Thanks
          YB

          Comment


            #6
            Unfortunately not. A single indicator can only populate a single panel. If you instead worked with a strategy, you could however use the StrategyPlot() technique to plot on multiple panels. This would consolidate all your calculations into one script which would not require multiple instances. http://www.ninjatrader.com/support/f...ead.php?t=6651
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              The latest approach sounds promissing.

              Thank you, Josh!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by cmoran13, 04-16-2026, 01:02 PM
              0 responses
              36 views
              0 likes
              Last Post cmoran13  
              Started by PaulMohn, 04-10-2026, 11:11 AM
              0 responses
              23 views
              0 likes
              Last Post PaulMohn  
              Started by CarlTrading, 03-31-2026, 09:41 PM
              1 response
              162 views
              1 like
              Last Post NinjaTrader_ChelseaB  
              Started by CarlTrading, 04-01-2026, 02:41 AM
              0 responses
              96 views
              1 like
              Last Post CarlTrading  
              Started by CaptainJack, 03-31-2026, 11:44 PM
              0 responses
              152 views
              2 likes
              Last Post CaptainJack  
              Working...
              X