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:	157
Size:	421.5 KB
ID:	1264291Thanks.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      31 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      124 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      64 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      41 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X