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 JoMoon2024, Today, 06:56 AM
      0 responses
      6 views
      0 likes
      Last Post JoMoon2024  
      Started by Haiasi, 04-25-2024, 06:53 PM
      2 responses
      19 views
      0 likes
      Last Post Massinisa  
      Started by Creamers, Today, 05:32 AM
      0 responses
      6 views
      0 likes
      Last Post Creamers  
      Started by Segwin, 05-07-2018, 02:15 PM
      12 responses
      1,786 views
      0 likes
      Last Post Leafcutter  
      Started by poplagelu, Today, 05:00 AM
      0 responses
      3 views
      0 likes
      Last Post poplagelu  
      Working...
      X