Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
        JimNinjaTrader Customer Service

        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
            JimNinjaTrader Customer Service

            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 fx.practic, 10-15-2013, 12:53 AM
              5 responses
              5,404 views
              0 likes
              Last Post Bidder
              by Bidder
               
              Started by Shai Samuel, 07-02-2022, 02:46 PM
              4 responses
              95 views
              0 likes
              Last Post Bidder
              by Bidder
               
              Started by DJ888, Yesterday, 10:57 PM
              0 responses
              8 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by MacDad, 02-25-2024, 11:48 PM
              7 responses
              159 views
              0 likes
              Last Post loganjarosz123  
              Started by Belfortbucks, Yesterday, 09:29 PM
              0 responses
              8 views
              0 likes
              Last Post Belfortbucks  
              Working...
              X