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 ldanenberg, Yesterday, 03:19 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by tkaboris, Today, 06:27 AM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_RyanS  
      Started by Option Whisperer, Yesterday, 07:58 PM
      5 responses
      22 views
      0 likes
      Last Post NinjaTrader_Erick  
      Started by BackToTheFutures, 08-17-2021, 03:15 PM
      9 responses
      733 views
      0 likes
      Last Post NinjaTrader_RyanS  
      Started by TheTradingMantis, 01-19-2023, 02:05 AM
      44 responses
      927 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X