Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Applying an indicator toa symbol or indicator plot in Panel 2

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

    Applying an indicator toa symbol or indicator plot in Panel 2

    If I have an indicator that detects swing highs and swing lows on the the symbol on the main chart, is there a way to apply that indicator to detect swing highs/lows on whatever is currently plotted in panel 2 (may be another market symbol or another indicator plot) without specifically adding it as a named data series?

    #2
    Hello Scotty33,
    Yes, you can change the input from Indicator settings dialog to apply your indicator on another indicator, you can select the indicator you wish to apply your indicator on. Hope it helps!

    Comment


      #3
      Thanks s.kinra. Perhaps I didn’t express my question correctly. I meant, in the script that identifies the highs/lows, is there a way to make the script identify the swing highs/lows in both the main chart and whatever is plotted in Panel 2?

      Comment


        #4
        Hello Scotty33,
        I guess no its not possible, you need to invoke it within your indicator to get working.

        Comment


          #5
          Hello Scotty33,

          An indicator can call another indicator. If you choose to, the logic in the host script can set to use the same parameters as the indicator applied directly to the chart in another panel.
          The host indicator would not be reading from the indicator applied to the chart, but would be calling that indicator internally in the code and returning a plot value. (NinjaTrader does do some caching for efficiency if these were to be using the same data and parameters)
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Hello Chelsea,
            Thanks for your reply. Do you mean that the indicator that calculates the swing highs/lows should effectively call itself and apply to the symbol/indicator in panel 2 to calculate swing highs/lows there?
            Do you have any examples of this approach that would help me to apply it?

            Comment


              #7
              Hello Scotty33,
              I think you can have a new indicator & then initialize your host indicator twice, use one for each series you wish to. So this new indicator will be calculating for 2 diff series & then you can plot both results. But again you can't plot in separate panels from a single indicator, however you can draw objects in price panel & indicator panel if this is in new panel and if you plan to plot on price panel you can't even draw object in indicator panel. Hope it helps!

              Comment


                #8
                Hello Scotty33,

                An indicator can call itself with different parameters if necessary.

                Or can be coded to have more parameters and use those for calculations.

                If the point is to use another data series for calculations it would make sense to add a data series with AddDataSeries() and use that series for calculations in the script.

                Unfortunately, scripts are not able to detect other scripts directly added to the chart.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  Thanks s.kinra and Chelsea for your suggestions. I'm going to experiment with your ideas and see if I can produce the results I want. If not, I'll probably be back with more questions

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by bortz, 11-06-2023, 08:04 AM
                  47 responses
                  1,605 views
                  0 likes
                  Last Post aligator  
                  Started by jaybedreamin, Today, 05:56 PM
                  0 responses
                  8 views
                  0 likes
                  Last Post jaybedreamin  
                  Started by DJ888, 04-16-2024, 06:09 PM
                  6 responses
                  18 views
                  0 likes
                  Last Post DJ888
                  by DJ888
                   
                  Started by Jon17, Today, 04:33 PM
                  0 responses
                  4 views
                  0 likes
                  Last Post Jon17
                  by Jon17
                   
                  Started by Javierw.ok, Today, 04:12 PM
                  0 responses
                  13 views
                  0 likes
                  Last Post Javierw.ok  
                  Working...
                  X