Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Need to change the bar color of the OrderFlowCumulativeDelta Bars

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

    Need to change the bar color of the OrderFlowCumulativeDelta Bars

    Hi,
    I am writing a strategy that uses the OrderFlowCumulativeDelta indicator (I have lifetime license).

    I am using OrderFlowCumulativeDelta as a reference via a private variable and have added the Tick data series and also calling Update in the OnBarUpdate method as documented. I am also added the OrderFlowCumulativeDelta indicator to the chart using the AddChartIndicator.

    The OrderFlowCumulativeDelta is loaded and is updating correctly.

    I am trying to change the Red/Green bar color of the OrderFlowCumulativeDelta based on certain condition. I can change the UpBrush and DownBrush property before adding it to the chart, but I don't know how to change them on OnBarUpdate.

    Can anyone please provide me a way to do this?

    Thanks.

    #2
    Hello rajneeshsehgal,

    Welcome to the NinjaTrader forums!

    Unfortunately, this script wasn't developed in a way that the color of a single bar can be changed.

    The rectangles are being custom rendered and is not a plot that can be changed with PlotBrushes.

    In a custom coded indicator, you could custom your own rectangle over the bar to change it to your color of preference. The ZOrder of your indicator should be higher than the CumulativeDelta.

    Below is a link to an example that draws rectangles over the bars.
    NinjaTrader 8 natively provides Heiken Ashi as a bar type for most common bar types (minute, tick, volume, second, day, week, month, year). This Heiken Ashi indicator is provided for the Range, Renko and any custom bar types that may be added. The indicator performs in the same manner as the NinjaTrader 7 version. 4-27-18 […]
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you so much Chelsea for the quick response. I tried the sample code you provided and made my own custom indicator that uses the Delta OHLC values calculated by OrderFlowCumulativeDelta and then plots them using rectangles as provided in the sample.

      It worked like a charm. Screenshot attached with my custom indicator and original order flow cumulative delta indicator.

      I will continue working on seeing how I can dynamically change the color of the bar based on the condition. I should be able to get it to work.

      I really appreciate your help.

      Click image for larger version

Name:	cdm.png
Views:	165
Size:	421.5 KB
ID:	1264291Thanks.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      90 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      137 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      120 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      72 views
      0 likes
      Last Post PaulMohn  
      Working...
      X