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 SalmaTrader, 07-07-2026, 10:26 PM
          0 responses
          35 views
          0 likes
          Last Post SalmaTrader  
          Started by CarlTrading, 07-05-2026, 01:16 PM
          0 responses
          20 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 06-17-2026, 10:32 AM
          0 responses
          13 views
          0 likes
          Last Post CaptainJack  
          Started by kinfxhk, 06-17-2026, 04:15 AM
          0 responses
          19 views
          0 likes
          Last Post kinfxhk
          by kinfxhk
           
          Started by kinfxhk, 06-17-2026, 04:06 AM
          0 responses
          22 views
          0 likes
          Last Post kinfxhk
          by kinfxhk
           
          Working...
          X