• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How do you get the bar color?

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

    How do you get the bar color?

    In an indicator, how do you retrieve the bar color? I do not want the "check for conditions" solution.. The indicator I am writing is checking for when another indicator paints the bar, so the check for this/that condition is not an option.

    #2
    Hello,

    Thank you for the question.

    The BarColor property will report as Color.Empty unless the script sets a value for that bar.

    The solution is to check the same condition as the other indicator in which paints the bars originally to duplicate the same logic.

    Unfortunately unless the other script explicitly exposes a signal or Color series, there is no way around this as the BarColor is only visible for the script that sets it. An example would be:

    Indicator 1 sets BarColor to Color.Red for ALL bars.
    Indicator 2 Reads BarColor, but it reports as Empty for ALL bars.

    This would be expected that each indicator has an empty bar color collection in which it can control the color of each bar.

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

    Comment


      #3
      What about for just the default bars on the chart? The ones that haven't been modified by an indicator.

      Comment


        #4
        Hello,

        These colors are also not accessible in the way you would like.

        You could access the Property that you set and get the Up or Down color for the base colors, but there would be no way to know which bars are each color.

        The Bars are colored with these colors based on the conditions of the ChartStyle being used. After this, if an Indicator has a conditions that additionally change the BarColor, these colors would be used for X bar instead of the base series color. The best solution would be if the indicator that is coloring the bars exposes a signal or color series. From that a strategy could tell what each bar color was

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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by akuntysh, Today, 09:21 PM
        0 responses
        1 view
        0 likes
        Last Post akuntysh  
        Started by goldfly, 08-27-2007, 07:05 PM
        12 responses
        11,506 views
        0 likes
        Last Post nkhoi
        by nkhoi
         
        Started by jrm999, Today, 07:44 PM
        0 responses
        2 views
        0 likes
        Last Post jrm999
        by jrm999
         
        Started by Iargo, Today, 05:53 PM
        0 responses
        5 views
        0 likes
        Last Post Iargo
        by Iargo
         
        Started by kadan, Today, 05:24 PM
        1 response
        5 views
        0 likes
        Last Post kadan
        by kadan
         
        Working...
        X