Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Chart Background Color

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

    Chart Background Color

    I'd like the background of a chart to be a certain color for a given time period everyday.
    My chart uses range bars.
    In this case, I'm using market replay.
    I tried myself but so far no luck.

    Help is appreciated.

    #2
    There is this indicator that I have used before.
    Multi functional repeater of up to 10 X and/or Y Highlight regions daily or day of week. User interface expands for up to 10 events. Each event configurable as a time region, price region, fixed rectangle or dynamic rectangle (adjusts on price), select a day of the week or daily. Update 6/18/2018 V2.2 ‐ Added […]

    You could use that, or use the Editor to open it up and look how they do it.

    Comment


      #3
      Hello reynoldsn,

      Thank you for your post.

      You may use the BackBrush property to paint the chart panel's background color for the current bar. In the example below, I use the ToTime() method to specify a given time period.

      Code:
      protected override void OnBarUpdate()
      {
      if (CurrentBar < 1)
      return;
      if (ToTime(Time[0]) >= ToTime(9, 45, 00) && ToTime(Time[0]) <= ToTime(12, 45, 00))
      BackBrush = Brushes.Red;
      // Sets the color of the background on the current bar as red
      }
      For more information, please consult the following Help Guide pages:Please let me know if I may be of any further assistance.​

      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