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 charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    49 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    141 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    160 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    96 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    275 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X