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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      80 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      54 views
      0 likes
      Last Post CarlTrading  
      Working...
      X