Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to check last bar's BackColor?

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

    How to check last bar's BackColor?

    Is there a way to reference previous bars backcolor. Try to play a sound if current backcolor is different than the last backcolor. Thanks in advance.

    #2
    billy822,

    Unfortunately not. If you want to see the bar color you can just check the conditions. If close > open then it is green. If close < open then it is red.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Another option you could try: Within your strategy, you could record the conditions in a DataSeries or StringSeries. When the conditions call for a bar color change, also set the series with a flag to indicate the status.

      If desired to have the color condition continue after the change (until the next change), you might use a variable which is zeroed at the change and then increments until the next change so that each series element may be set accordingly.

      OregonSun

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      597 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      343 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      556 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      555 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X