Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CalculateOnBarClose=false for paint bars

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

    CalculateOnBarClose=false for paint bars

    Hi Everyone, using CalculateOnBarClose=false for paint bars, lets say a condition to paint inside bars:

    #region Variables
    private Color color2 = Color.Yellow;
    ------------------
    protected override void OnBarUpdate()
    if (High[0] < High[1] && Low[0] > Low[1] )
    CandleOutlineColor = Color2;

    Now if the bar starts as an inside bar, wich almost every bar does, and then before the close of this bar it changes to a High[0]>High[1] && Low[0]>Low[1] for example, the bar is still painted because the condition was met some point during the construction of that bar.

    My question is how to evercome this limitation for paint bars?
    Thanks for the support your company is the best for both software and support.

    Marreta
    Last edited by marreta; 02-26-2015, 12:58 PM.

    #2
    Hello Marreta,

    Thank you for posting.

    You would want to use CalculateOnBarClose to true so that at the end of the bar being built it gets processed correctly.

    Otherwise, you will need to have additional checks for when this condition is no longer true and change the color back on the bar.

    So -
    Code:
    if(High[0] > High[1] && Low[0] > Low[1])
    CandleOutlineColor = Color.Black;
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Hi Cal, perfect example. Thats what I needed. Thank you verry much.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      579 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      334 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
      554 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      551 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X