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 FrancisMorro, Today, 03:24 AM
    0 responses
    1 view
    0 likes
    Last Post FrancisMorro  
    Started by Segwin, 05-07-2018, 02:15 PM
    10 responses
    1,769 views
    0 likes
    Last Post Leafcutter  
    Started by Rapine Heihei, 04-23-2024, 07:51 PM
    2 responses
    30 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by Shansen, 08-30-2019, 10:18 PM
    24 responses
    943 views
    0 likes
    Last Post spwizard  
    Started by Max238, Today, 01:28 AM
    0 responses
    10 views
    0 likes
    Last Post Max238
    by Max238
     
    Working...
    X