• 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?
    JoshNinjaTrader 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
        JoshNinjaTrader 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, 07:22 AM.
            JoshNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by roblogic, Yesterday, 04:06 AM
            1 response
            10 views
            0 likes
            Last Post koganam
            by koganam
             
            Started by nepenthean, Today, 08:01 AM
            0 responses
            7 views
            0 likes
            Last Post nepenthean  
            Started by bxl2019, Today, 07:59 AM
            0 responses
            4 views
            0 likes
            Last Post bxl2019
            by bxl2019
             
            Started by tcfcigvo, Yesterday, 11:39 PM
            0 responses
            8 views
            0 likes
            Last Post tcfcigvo  
            Started by BobbyWan, Yesterday, 09:15 PM
            0 responses
            11 views
            0 likes
            Last Post BobbyWan  
            Working...
            X