• 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

Chart Bars

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

    Chart Bars

    Is there a way to directly access the Color of a Chart bar candle x bars back without having to either remember it or calculate it.

    In other words is it in a Bar Series and if so How do I access it.

    Thanks

    #2
    Hello,

    Unfortunately this is not possible. You would either need to create similar logic to know when the bars should be painted, or have the item that is actually painting the bars expose a Plot which can be accessed from other scripts. The Brushes used for each bar would only relate to the script that sets it, otherwise the charts default up or down brush would be used. These colors can be set in the Data Series window.

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

    Comment


      #3
      Jesse,
      Thank you, can I alter the Bar Type and add a data Series / Plot series to the BarType which defines this public. I am just not quite sure how to Access it once created as I tired changing one of the BarType vars to Public and the editor doesn't seem to see it. Although I didn't try making it a plot series.

      Comment


        #4
        Hello,

        You wouldn't be able to add a Plot to a BarsType, the BarsType is specifically for taking data and building bars but has nothing to do with Bar coloring. A ChartStyle would be used to define the Colors you see on a standard chart like a CandleStick but would overridden by any scripts that set the BarBrush.

        If you are trying to detect a condition that some script sets like when an indicator changes the BarBrush, you would need to replicate the logic in the indicator or add a plot to that specific indicator that exposes a signal. There is no correct way to access the the individual brushes used on each bar.

        If you are instead referring to color changes from a chart style, like when a up or down bar occurs for a candlestick type chart, you would need to review that chart style and its logic to see how it differentiates bars. You could then use similar logic in your script using the price data the script can see.

        The Brushes used in the platform would not be a good item to compare as the platform was not created in a way that lets you access these values, there are also multiple factors in how a bar is colored which makes this more difficult to drill down to the specific bars brush.

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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by vivekniwas, Today, 04:56 PM
        0 responses
        3 views
        0 likes
        Last Post vivekniwas  
        Started by dtl-saw, Today, 03:36 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Started by williamzz, Today, 02:04 PM
        2 responses
        11 views
        0 likes
        Last Post williamzz  
        Started by jtrading82, Today, 01:55 PM
        3 responses
        27 views
        0 likes
        Last Post NinjaTrader_Tyler  
        Started by StevenNelson, Today, 01:00 PM
        4 responses
        19 views
        0 likes
        Last Post StevenNelson  
        Working...
        X