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

Getting Indicator Values from another pane

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

    Getting Indicator Values from another pane

    Can an Indicator check for the presence of another indicator in the same chart and if it exists, access publicly exposed data series? I was reviewing the section of the help guide regarding ChartControl.Indicators and it appeared that I would be able to iterate a list of indicators in the chart. Just wondering if I could go deeper than that and access the actual data.

    The reason I am asking is that I find it cumbersome that, if I use AddDataSeries to build any custom Indicator, essentially, none of the built in indicators are usable on my custom indicator since those would also need to have been written to add the data series. Is this a known shortcoming? It seems incredibly inflexible that just adding one data series to a custom indicator renders all of the other indicators useless on the data my custom Indicator produces. I feel like I am missing something.

    If I am correct, can an add on overcome this? In other words, can an add on be built that can be added to a chart like a custom indicator but perhaps has a little more control?

    #2
    Hello swcooke,

    The collection you found can be used to access indicators however the use case you are asking for would not be a good use case for that collection.

    Can you provide a specific example of the situation which you are having trouble with in regard to other indicators and your indicator adding a series? I am not certain I understand from your description the shortcoming that you are describing.


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Do any good examples already exist for accessing Indicator data within a chart from another Indicator using ChartControl.Indicators? The only example I see is the one at that link which does not provide that much context. I'd like to at least be familiar with the concept.

      Comment


        #4
        Hello swcooke,

        Not that I am aware of, that is a collection of the charts indicators but is not suggested to be used for accessing Series related data so there are not guides to do that. The suggested way to access Series data is to use the built in system, that is just calling it by its name like SMA(12). The independent indicators on the chart have no order which they will calculate so you could see updates before or after the other indicator using the collection. If you can provide a specific example of what the problem is we can go over that and see if there is a dedicated or correct way to do what you wanted using the existing indicator system.

        The Indicators collection is considered an advanced item which is more or less left up to developers to figure out what to do with it. If you want to experiment there and work out a system to access the specific data points you want from the other indicator you can certainly try using the GetValueAt method for any series. That requires specifying the Index you want. Two separate running Indicators are not going to be directly in sync and may have varied index counts so one indicators CurrentBar may not represent the same point in another indicator to make comparisons based on BarsAgo as an example. If you mean to do comparisons where the bars need to be in sync that is not likely a good solution. If you just needed to pull a last price or a property from the indicator that is more easily accomplished using this collection.



        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Hi Jesse,

          I'd like to send you a private email with a very short video explaining my issue. Is that OK? If so, where would I send?

          Comment


            #6
            Hello swcooke,

            You can post a link here, you would need to host the video somewhere if that is how you want to provide a reply. If the video shows code that cant be public you should instead make a specific sample to demonstrate your issue that you can post here with your question.


            Please let me know if I may be of further assistance.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by martin70, 03-24-2023, 04:58 AM
            14 responses
            105 views
            0 likes
            Last Post martin70  
            Started by TraderBCL, Today, 04:38 AM
            0 responses
            2 views
            0 likes
            Last Post TraderBCL  
            Started by Radano, 06-10-2021, 01:40 AM
            19 responses
            606 views
            0 likes
            Last Post Radano
            by Radano
             
            Started by KenneGaray, Today, 03:48 AM
            0 responses
            4 views
            0 likes
            Last Post KenneGaray  
            Started by thanajo, 05-04-2021, 02:11 AM
            4 responses
            470 views
            0 likes
            Last Post tradingnasdaqprueba  
            Working...
            X