Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Change the DrawRegion

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

    Change the DrawRegion

    Hello,
    I'm attempting to change the DrawRegion of my indicator according to the values of the WilliamsR. Unfortunately I'm missing something. I'm not getting any Opacity change. It stays green. Anyone know how to do this. Here is the code:
    // Calculate Williams value
    double value1 = WilliamsR(14)[0];
    double value2 = WilliamsR(150)[0];

    if (value2 > -50
    && value1 < -75)
    {
    DrawRegion("Region", CurrentBar, 0, Upper, Lower, Color.Empty, Color.Red, Opacity);
    }
    else
    {
    DrawRegion("Region", CurrentBar, 0, Upper, Lower, Color.Empty, Color.Green, Opacity);
    }

    Upper.Set(VMA(High, Length, Volatility)[0]);
    Lower.Set(VMA(Low, Length, Volatility)[0]);

    #2
    Hello,

    Thanks for the forum post.

    What is the variable Opacity set too?

    -Brett
    BrettNinjaTrader Product Management

    Comment


      #3
      The variable opacity is set to 2.

      Comment


        #4
        areaOpacity
        Sets the level of transparency for the fill color. Valid values between 0 - 10. (0 = completely transparent, 10 = no opacity)


        Try setting it to 0.


        -Brett
        BrettNinjaTrader Product Management

        Comment


          #5
          Brett, thanks for the reply but, still no change.

          Comment


            #6
            Would need to add Prints then to find out how Opacity is getting set to something other then 0. As you need 0 for it to be completely transparent.

            You sure you dont have any manually drawn regions right correct?

            Finally this only sets the fill. If it the fill or the outline that you can see or both?

            -Brett
            BrettNinjaTrader Product Management

            Comment


              #7
              It's been a while since I've done this and used Print to find my error. Could you give me a quick reminder how to do that?

              Comment


                #8
                Ok I remembered the Print(). It shows that that I should be getting a red color at the right times, but I'm not getting it. I'll keep checking.

                Comment


                  #9
                  Ok I've viewed it in real time and it's changing, but it changes the entire channel history instead of creating a new color at the new bar. Can you point me in the direction of a method that would keep the color change historically.

                  Comment


                    #10


                    You want to make sure that setting isnt changing you need to find the code that is changing it if its changing.
                    BrettNinjaTrader Product Management

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    602 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    347 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    103 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    559 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    558 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X