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 zstheorist, Today, 07:52 PM
    0 responses
    3 views
    0 likes
    Last Post zstheorist  
    Started by pmachiraju, 11-01-2023, 04:46 AM
    8 responses
    149 views
    0 likes
    Last Post rehmans
    by rehmans
     
    Started by mattbsea, Today, 05:44 PM
    0 responses
    5 views
    0 likes
    Last Post mattbsea  
    Started by RideMe, 04-07-2024, 04:54 PM
    6 responses
    33 views
    0 likes
    Last Post RideMe
    by RideMe
     
    Started by tkaboris, Today, 05:13 PM
    0 responses
    5 views
    0 likes
    Last Post tkaboris  
    Working...
    X