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

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 Jon17, Today, 04:33 PM
        0 responses
        1 view
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        6 views
        0 likes
        Last Post Javierw.ok  
        Started by timmbbo, Today, 08:59 AM
        2 responses
        10 views
        0 likes
        Last Post bltdavid  
        Started by alifarahani, Today, 09:40 AM
        6 responses
        41 views
        0 likes
        Last Post alifarahani  
        Started by Waxavi, Today, 02:10 AM
        1 response
        20 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Working...
        X