Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Region drawing borders but no fill color.

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

    Region drawing borders but no fill color.

    Scenario: I am drawing 2 regions using DRAWREGION but there i no fill color. The borders show but the fill is blank.

    Here is the code I am using to draw the regions. I am using the left Axis. I do have a custom zorder to show price bars above if drawn in price panel.

    DrawRegion( "Shorts_Region", CurrentBars[0], 0 , Values[6], Values[7], Color.Pink, Color.Pink, 7);
    DrawRegion( "Longs_Region", CurrentBars[0], 0 , Values[4], Values[5], Color.PaleGreen, Color.PaleGreen, 7);

    Not sue where that pink background if coming from in the screenshot. Will look at that later.

    Cheers Click image for larger version  Name:	MNQ 06-21 (5 Tick)  4_29_2021.jpg Views:	3 Size:	169.9 KB ID:	1153891

    Last edited by ct; 04-29-2021, 01:48 AM.

    #2
    Can you change the color to brushes ?

    DrawRegion( "Shorts_Region", CurrentBars[0], 0 , Values[6], Values[7], Brushes.Pink, Brushes.Pink, 7);
    DrawRegion( "Longs_Region", CurrentBars[0], 0 , Values[4], Values[5], Brushes.PaleGreen, Brushes.PaleGreen, 7);

    Comment


      #3
      The compiler is not happy so to respond to your question, looks like a "No". It says " cannot convert system.drawing.brush to system.drawing.color" and some other related error messages.

      Cheers

      Comment


        #4
        Hello ct,

        Thanks for your post.

        I have moved this thread to the NinjaTrader 7 forum as it looks like the code is for NinjaTrader 7 and not for NinjaTrader 8.

        It looks like the regions are being drawn appropriately, just in the wrong panel. Do you by chance have DrawOnPricePanel set to true?



        We look forward to hearing from you.

        Comment


          #5
          Jim

          Sorry for posting to the wrong forum. Yes I do have DrawOnPricePanel set to true. I removed it, recompiled it and pressed f5 to reload the chart. Got the same result, no fill on the region but do get the outline. I removed the indicator from the chart and added it back. Same result, no color fill.

          Any suggestions?

          Cheers
          Last edited by ct; 04-29-2021, 09:00 AM.

          Comment


            #6
            Hello ct,

            The default value for DrawOnPricePanel is true, so if you removed the line of code, it will still be true.

            Can you set this value to false, recompile, and then remove/re-add the script?

            If that doesn't resolve can you move the code to a new script so the issue is isolated, and then attach that script here for our review?

            Exporting as source code - https://ninjatrader.com/support/help...nt7/export.htm

            Comment


              #7
              Jim

              That change did it, Yeah! It looks fine now.

              You are a star.

              Many thanks.

              Cheers

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              557 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              324 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              101 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              545 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              547 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X