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

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

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Option Whisperer, Today, 09:55 AM
      0 responses
      3 views
      0 likes
      Last Post Option Whisperer  
      Started by geddyisodin, 04-25-2024, 05:20 AM
      8 responses
      58 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by halgo_boulder, 04-20-2024, 08:44 AM
      2 responses
      21 views
      0 likes
      Last Post halgo_boulder  
      Started by mishhh, 05-25-2010, 08:54 AM
      19 responses
      6,189 views
      0 likes
      Last Post rene69851  
      Started by gwenael, Today, 09:29 AM
      0 responses
      5 views
      0 likes
      Last Post gwenael
      by gwenael
       
      Working...
      X