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 llanqui, Today, 03:53 AM
      0 responses
      5 views
      0 likes
      Last Post llanqui
      by llanqui
       
      Started by burtoninlondon, Today, 12:38 AM
      0 responses
      10 views
      0 likes
      Last Post burtoninlondon  
      Started by AaronKoRn, Yesterday, 09:49 PM
      0 responses
      15 views
      0 likes
      Last Post AaronKoRn  
      Started by carnitron, Yesterday, 08:42 PM
      0 responses
      11 views
      0 likes
      Last Post carnitron  
      Started by strategist007, Yesterday, 07:51 PM
      0 responses
      14 views
      0 likes
      Last Post strategist007  
      Working...
      X