• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw.Region with ScaleJustification other than Right

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

    Draw.Region with ScaleJustification other than Right

    I'm trying to fill an area between two bands. Relevant indicator settings:

    DrawOnPricePanel = true;
    IsOverlay = true;
    ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Overlay;

    It seems Draw.Region only works when ScaleJustification is set to Right. Is this right?.. No mention of that in the docs. I notice there is no isAutoScale parameter unlike with other Draw methods.

    Any way to get Draw.Region to work with ScaleJustification.Overlay?

    #2
    Hello digibob,
    Thanks for your post.

    Draw.Region does work with ScaleJustification.Overlay and I am able to set Draw.Region to any of the three ScaleJustification options on my end. Are you saying that you set the ScaleJustification in your code and when you apply it to the chart it is being set to something else?

    Are there errors on the logs tab of your Control Center?
    Josh G.NinjaTrader Customer Service

    Comment


      #3
      Hi Josh. Thanks for your reply. There are no related errors in the logs tab. Please see the screenshot below. The yellow lines are two Series plots in overlay scale. Draw.Region is supposed to fill between the lines but the operation is performed on the price scale.

      OnBarUpdate:

      Values[0][0] = 26;
      Values[1][0] = 25;

      Draw.Region(this, "Fill", CurrentBar, 0, Values[0], Values[1], null, Brushes.Gray, 40);

      You say you were able to *set* Draw.Region to any of the three ScaleJustification options. I may be missing something here. How do you set Draw.Region to a ScaleJustification? There is no ScaleJustification parameter to the function. Is setting the ScaleJustification in State.SetDefaults not enough to let Draw.Region know which scale to use?

      Comment


        #4
        digibob,

        You are not missing anything there, I was referring to the ScaleJustification inside State.SetDefaults

        Do you have DrawOnPricePanel set to false?
        https://ninjatrader.com/support/help...pricepanel.htm
        Josh G.NinjaTrader Customer Service

        Comment


          #5
          As per my first post:

          DrawOnPricePanel = true;
          IsOverlay = true;
          ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Overlay;

          As per my second post with screenshot attached, when I draw on the price panel the ScaleJustification.Overlay is ignored and ScaleJustification.Right is used instead.

          Comment


            #6
            digibob,

            It looks like setting DrawOnPricePanel to false will be what you need for this to scale how you expect.

            As per my second post with screenshot attached, when I draw on the price panel the ScaleJustification.Overlay is ignored and ScaleJustification.Right is used instead.
            Are you printing out the ScaleJustification and seeing that this is actually the case or are you simply seeing this on the chart?
            Last edited by NinjaTrader_JoshG; 05-17-2019, 06:22 AM.
            Josh G.NinjaTrader Customer Service

            Comment


              #7
              Yes, you are right. DrawOnPricePanel set to false does the trick. I can't say I get it though. Setting this to false I was expecting the drawing to take place on another panel all together, not just another scale. I suppose that in combination with IsOverlay set to true it means "draw on the price panel but not using the price scale". The name DrawOnPricePanel and having to set it to false in this case is a little misleading. Maybe it's just my English.

              Thanks for your help Josh.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by AxelrodWins, Yesterday, 09:56 PM
              0 responses
              11 views
              0 likes
              Last Post AxelrodWins  
              Started by trader14, Yesterday, 08:12 PM
              0 responses
              8 views
              0 likes
              Last Post trader14  
              Started by ypbtrainer, Yesterday, 05:38 PM
              0 responses
              3 views
              0 likes
              Last Post ypbtrainer  
              Started by GARZONJ, 01-17-2020, 11:22 PM
              1 response
              14 views
              0 likes
              Last Post NinjaTrader_ChrisL  
              Started by mike09, 01-17-2020, 07:37 PM
              1 response
              25 views
              0 likes
              Last Post NinjaTrader_ChrisL  
              Working...
              X