Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Background color for curent bar and beyond

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

    Background color for curent bar and beyond

    Hi, I would like to paint the whole chart background with a different color, for which I use: BackBrush = Brushes.PaleGreen; under OnBarUpdate.
    BUT: that works only on the background for all closed bars, not on the background behind the current bar and beyond.
    Click image for larger version  Name:	ChartBackground.png Views:	0 Size:	8.4 KB ID:	1240421
    Is there a way how to achieve also the background to the right has the desired color?​

    Thanks
    P.

    #2
    I have had this need arise as well. It would be nice if there were an addressable property for this (the right margin area, not the whole chart background). Or, maybe a flag that if set, causes the color of the last bar extends all the way to the edge. What I've done is do this in OnRender, but that's a bit of a hack in the absence of a property for it.

    Of course, if you just want to color the current bar, you need to set your CalculateMode to OnPriceChange or OnEachTick so it runs on that bar (and make sure your indicator is written in a way that is safe to run intrabar).
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      Hello cyberpete76,

      Thanks for your post.

      QuantKey_Bruce is correct. There is no available method or property that colors the right margin of a chart at this time.

      I have submitted a feature request to the Development team to add a property that allows you to color the right margin of a chart. This request is being tracked under the number SFT-5810.

      As with all feature requests, interest is tracked before implementation is considered, so we cannot offer an ETA or promise of fulfillment. If implemented, it will be noted in the Release Notes page of the Help Guide.

      Release Notes — https://ninjatrader.com/support/help...ease_notes.htm

      As QuantKey_Bruce stated, if you want to color the current bar with BackBrush, you could set the script to use Calculate.OnPriceChange or OnEachTick.

      Please let me know if I may assist further.

      <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


        #4
        Thank you guys! I went for the OnPriceChange. It is not exactly what I wanted, but it comes close.
        Peter

        Comment

        Latest Posts

        Collapse

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