Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with Color Bar indicator

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

    Help with Color Bar indicator

    This simple ColorBar indicator is not working. Can someone help?
    Here is the code:
    ====================
    protected override void OnBarUpdate()
    {
    //Are there enough bars
    //if (CurrentBar < Period) return;
    // Use this method for calculating your indicator values. Assign a value to each
    // plot below by replacing 'Close[0]' with your own formula.

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

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

    }
    ===============
    end
    thanks!!!

    #2
    Hello,

    Please put this at the top of your OnBarUpdate() block and see if it helps:

    if(CurrentBar < 1) return;

    (Or just delete the "//" marks from left of the CurrentBar condition you already have.)

    This link will help:


    What is probably happening is you are referring to an index of 1 before it exists.
    DenNinjaTrader Customer Service

    Comment


      #3
      quick question paint bars

      Hello,

      If you have the paint bar indicator or have ben able to get one do you mind sharing?

      I use only bars when trading, I see there are lots of heikin ashi indicators
      in this forum but nothing for strickly bars?

      Please let me know, if I have to pay I will.

      thanks,

      Colin

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      164 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      318 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      246 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      350 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      179 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X