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

Access attributes of another indicator

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

    Access attributes of another indicator

    Let's say I have 2 existing indicators: A, B. I want to create another indicator X that includes information from A and B. Without changing A and B at all, how can I access all the information about A and B?

    I found this:

    IndicatorA(Param1, Param2, etc.).Value[0]

    worked to get me the value of one of them. But how do I get the color (the color changes over time in this indicator)?

    Also, one of them is a paintbar, so I want to get the color of that, too.

    Thanks!

    #2
    Originally posted by taotree View Post
    Let's say I have 2 existing indicators: A, B. I want to create another indicator X that includes information from A and B. Without changing A and B at all, how can I access all the information about A and B?

    I found this:

    IndicatorA(Param1, Param2, etc.).Value[0]

    worked to get me the value of one of them. But how do I get the color (the color changes over time in this indicator)?

    Also, one of them is a paintbar, so I want to get the color of that, too.

    Thanks!
    You will need to expose values that represent the color states of your paint bar. The following reference sample will be of help.

    RayNinjaTrader Customer Service

    Comment


      #3
      If I understand your answer correctly, it doesn't satisfy my question. I said, without changing indicator A or B. Are you saying that there is no way to find out the color of a plot in another indicator?

      Comment


        #4
        Originally posted by taotree View Post
        If I understand your answer correctly, it doesn't satisfy my question. I said, without changing indicator A or B. Are you saying that there is no way to find out the color of a plot in another indicator?
        Color of a plot does not change.
        You can access it (if it is regular plot)

        Color mycolor = IndicatorA().Plots[0].Pen.Color;

        Comment


          #5
          How to access current plot color

          I have a 3rd party indicator which plots a line. The line can be one of 3 colors. I want to be able to access the current color in a strategy. Is there any way to do this? I can't see that they've exposed any public property to indicate the current color.

          Comment


            #6
            saturntd, welcome to our forums! Can you access the third party indicator code? Then it would be easiest to work with the conditions leading to the line color changes...
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Bertrand thanks for the response. I can't access their code it's proprietary.

              Comment


                #8
                Then you should contact them and ask to add exposed indicator / signal states to their next revision if possible.
                BertrandNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Segwin, 05-07-2018, 02:15 PM
                14 responses
                1,789 views
                0 likes
                Last Post aligator  
                Started by Jimmyk, 01-26-2018, 05:19 AM
                6 responses
                837 views
                0 likes
                Last Post emuns
                by emuns
                 
                Started by jxs_xrj, 01-12-2020, 09:49 AM
                6 responses
                3,293 views
                1 like
                Last Post jgualdronc  
                Started by Touch-Ups, Today, 10:36 AM
                0 responses
                13 views
                0 likes
                Last Post Touch-Ups  
                Started by geddyisodin, 04-25-2024, 05:20 AM
                11 responses
                63 views
                0 likes
                Last Post halgo_boulder  
                Working...
                X