Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawRegion confusion

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

    DrawRegion confusion

    Hello,

    I'm attempting to place a DrawRegion on my (historical) chart that will dynamicly change the opacity values according to a variable. I'm having trouble because the "tag" parameter constantly erases and re-draws the DrawRegion on the chart each time called so there is no non-continuous shaded area of various opacities...it seems the "tag" parameter is necessary and cannot be omitted, how can I get around this? For example:

    int tracks = 4; //set the number of bars to use for the Region
    int pressure = 6; //set the value for opacity

    DrawRegion("tag1", tracks, 0, Bollinger(2, 14).Upper, Bollinger(2, 14).Lower, Color.Empty, Color.Lime, pressure);

    As stated this will color the area between the Bollinger bands however only until the DrawRegion command is called again and then the Region is re-drawn and the "old" Region is erased...can't I just have a continuous region colored in on the chart with differing opacities based upon a variable value? Thanks in advance.

    #2
    Burga1, if you want a new region to draw every time, you'll have to assign them unique drawing tags (with CurrentBar, which changes for every bar), like this:
    Code:
    DrawRegion("my region" + CurrentBar, tracks, 0, Bollinger(2, 14).Upper, Bollinger(2, 14).Lower, Color.Empty, Color.Lime, pressure);
    AustinNinjaTrader Customer Service

    Comment


      #3
      Thank you for your help Austin. That solves the problem...

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      88 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      48 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      31 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      34 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      68 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X