Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Coloring a region between two doble values

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

    Coloring a region between two doble values

    Hi,

    I have created an indicator which uses two lines:

    AddLine(Brushes.Crimson, Value1, "BandInf");
    AddLine(Brushes.Green, Value2, "BandaSup");

    Value 1 is 1.0 and Value 2 is 2.0.

    I would like to know how to color the region between those two lines (which use two double values). I tried to do it using Draw.Region():

    Draw.Region(this, "tag1", CurrentBar, 0, Value1, Value2, null, Brushes.Blue, 50);

    But it does not allow me to do that. I get an error message which says that the variables can't be converted.

    Is there any way to do it?

    Thank you!

    #2
    Hello Plaket,

    Thank you for the post.

    The Draw.Region tool expects two ISeries as inputs. Unless you have a plot to pass into that indicator it will not work with two double values. Since you are coloring the region between two static horizontal lines, you may use the Draw.RegionHighlightY() drawing tool.

    Please let me know if I can assist further.

    Comment


      #3
      Thanks ChrisL.

      If I write the next line on the indicator:

      Draw.RegionHighlightY(this, "tag1", false, 2, 0, Brushes.Blue, Brushes.Green, 20);

      it draws a region on the chart panel, however I need to draw the region on the indicator panel. Is there any other solution?

      Thank you!

      Comment


        #4
        Hello Plaket,

        Set DrawOnPricePanel to false and then remove the instance of the indicator and add a new instance.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thank you!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          576 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          334 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          553 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X