Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Inside Bar

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

    Inside Bar

    I was wondering if anyone has code to color an inside bar. So, down bar (red), up bar(red), inside bar(any othercolor ).

    Thanks!
    B

    #2
    Hello,

    Right click your chart>Properties and send up bars and down bars to Red. If you define "inside bar" by opens and closes try something like this:

    if(Math.Max(Close[0], Open[0]) < Math.Max(Close[1], Open[1])
    && Math.Min(Close[0], Open[0]) > Math.Min(Close[1], Open[1]))
    {
    BarColor = Color.Blue;
    }

    If you define "inside bar" by highs and lows try something like this:

    if(High[0] < High[1] && Low[0] > Low[1])
    {
    BarColor = Color.Blue;
    }

    I have not tested this, so test it first. Also, if you determine "inside bar" another way, you can always change this up to reflect your criterions.
    Last edited by NinjaTrader_Ben; 11-06-2008, 01:44 PM.
    DenNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

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