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 Tim-c, Today, 02:10 PM
                1 response
                6 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by Taddypole, Today, 02:47 PM
                0 responses
                1 view
                0 likes
                Last Post Taddypole  
                Started by chbruno, 04-24-2024, 04:10 PM
                4 responses
                50 views
                0 likes
                Last Post chbruno
                by chbruno
                 
                Started by TraderG23, 12-08-2023, 07:56 AM
                10 responses
                399 views
                1 like
                Last Post beobast
                by beobast
                 
                Started by lorem, Yesterday, 09:18 AM
                5 responses
                23 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Working...
                X