Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

how to have two colors in one bar?

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

    how to have two colors in one bar?

    Is there a way to have the bottom part of a bar one color and the top part of the bar another?

    thx

    #2
    Hello llanqui,

    Thanks for your post.

    To clarify, are you referring to changing the color of a bar on the chart so that it is two different colors?

    There are no supported methods or properties available to make a single bar two separate colors.

    A bar on the chart is only able to be set to a single color by specifying BarBrush or BarBrushes.

    BarBrush: https://ninjatrader.com/support/help...8/barbrush.htm
    BarBrushes: https://ninjatrader.com/support/help...barbrushes.htm
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Hello llanqui,

      Thanks for your note.

      This could possibly be accomplished by custom rendering on top of the bars like the HeikenAshi8 indicator does. You could color half the bar one color and the other half another color.

      Note that this would require custom rendering two rectangles.

      You could view the SampleCustomRender script that comes default with NinjaTrader to gain a good understanding of working with SharpDX. To view the script, open a New > NinjaScript Editor window, open the Indicators folder, and double-click on the SampleCustomRender file.

      HeikenAshi8 indicator: https://ninjatraderecosystem.com/use...heiken-ashi-8/
      Using SharpDX for Custom Chart Rendering: https://ninjatrader.com/support/help..._rendering.htm
      OnRender: https://ninjatrader.com/support/help...htsub=onrender
      RenderTarget.DrawRectangle: https://ninjatrader.com/support/help...wrectangle.htm
      <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      596 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      343 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      556 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      554 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X