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 PH_GMT, 02-12-2025, 12:40 PM
      9 responses
      52 views
      0 likes
      Last Post PH_GMT
      by PH_GMT
       
      Started by Eagleeye76, Today, 05:02 PM
      0 responses
      6 views
      0 likes
      Last Post Eagleeye76  
      Started by sebinho, Today, 03:33 PM
      0 responses
      12 views
      0 likes
      Last Post sebinho
      by sebinho
       
      Started by Babbou72, 02-15-2025, 08:37 PM
      25 responses
      108 views
      0 likes
      Last Post rockmanx00  
      Started by bertochi, 02-14-2025, 05:25 PM
      6 responses
      52 views
      0 likes
      Last Post bertochi  
      Working...
      X