Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Minor glitch Draw.Region()

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

    Minor glitch Draw.Region()

    When using Draw.Region() overlaod with the displacement feature, the shading is not performed correctly, when a negative Displacement is entered via the indicator dialogue box.

    The problem can be easily seen when a chart is scrolled back horizontally. To reproduce, please use an indicator that shades several segments with different tags, not an indicator with a single region over the entire chart.

    Also see charts attached.
    Attached Files

    #2
    Hello,

    Thank you for the post.

    I was able to see this with another region tool from the forum, I will review this further and if I have any other details I will post back.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello,

      Thank you for the post.

      I was able to see this with another region tool from the forum, I will review this further and if I have any other details I will post back.

      I look forward to being of further assistance.

      Thank you for your response.

      It is a minor issue and of little importance.

      It only happens with negative displacements.

      I personally do not use negative displacements, as they will only yield values for past bars but not for the current bar.

      I only mentioned it, because NinjaTrader allows for negative displacements, and in that case Draw.Region() should behave in a similar fashion as the plots.

      Comment


        #4
        More issues with Draw.Region()

        Draw.Region does not currently observe the BarsRequiredToPlot criterion, which it should, see screenshot below.

        Observed for NinjaTrader 8.0.1.0.
        Attached Files

        Comment


          #5
          Hello Harry,

          Thanks for your post.

          Can you provide a sample indicator/code that can demonstrate this?

          Thank-you.
          Paul H.NinjaTrader Customer Service

          Comment


            #6
            Attached is a quick and dirty version of the Bollinger Bands,

            I have taken the Bollinger Bands indicator that ships with NinjaTrader and added a channel fill with DrawRegion().

            You will notice that the channel fill starts from the very first bar and does not respect the training period imposed by BarsRequiredToPlot.
            Attached Files

            Comment


              #7
              Same indicator as before.

              With a negative displacement, no proper filling of the channel.
              Attached Files

              Comment


                #8
                There are also problems when a positive displacement is applied to the chart.

                Parts of the channel are not colored.

                This can only be observed with indicators that divide the channel into segments, with each segment carrying a different tag.
                Attached Files

                Comment


                  #9
                  Originally posted by Harry View Post
                  Draw.Region does not currently observe the BarsRequiredToPlot criterion, which it should, see screenshot below.
                  BarsRequiredToPlotis for plots not drawings.

                  Your script should not draw if it has not reached that point.

                  Comment


                    #10
                    Hello Harry,

                    Thanks for your posts and sample code.

                    We will investigate the displacement observations and update this thread when we have further information.
                    .
                    Paul H.NinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by aslane View Post
                      BarsRequiredToPlotis for plots not drawings.

                      Your script should not draw if it has not reached that point.

                      I see your point. It is easy to modify the script not to plot during the training period.

                      All that is needed is to replace

                      Code:
                      Draw.Region(this,"UB3", CurrentBar, 0, Upper, Lower, transparentBrush, FillBrush, Opacity, Displacement);
                      with

                      Code:
                      Draw.Region(this,"UB3", Math.Max(0, CurrentBar-BarsRequiredToPlot), 0, Upper, Lower, transparentBrush, FillBrush, Opacity, Displacement);
                      so it is not really an issue. Maybe it is sufficient to modify the example given in the help file to show how to align Draw.Region() with the plots.

                      / Draw a region between upper and lower Bollinger bands Draw.Region(this,"tag1",CurrentBar,0,Bollinger(2,14).Upper,Bollinger(2,14).Lower,null,Brushes.Blue,50);

                      Comment


                        #12
                        NT 8.0.3. Minor glitch converted into bug!

                        With NT 8.0.2 the displacement for DrawRegion() was not working properly, but the new release NT 8.0.3 makes it completely unusable.

                        Please find attached two charts.

                        First chart = original chart without displacement
                        Second chart = same chart but diplaced by 10 bars

                        You will notice that the displaced chart is a mess, as the start and end points of the section of the original channel are not properly displaced.

                        However, I must admit that the new displacement feature has an artistic value!
                        Attached Files
                        Last edited by Harry; 01-17-2017, 05:35 PM.

                        Comment


                          #13
                          Hello Harry,

                          Thanks for your post.

                          We will reopen the investigation on this and will update this thread when we have further information.

                          Thanks again for reporting on this.
                          Paul H.NinjaTrader Customer Service

                          Comment


                            #14
                            Hello Harry,

                            This has been identified as a bug and has been assigned to NT8-11059, "Draw.Region displacement overload is not including BarsRequiredToPlot to determine start point".

                            On a temporary basis you might use CurrentBar - BarsRequiredToPlot - Displacement.

                            For example: Draw.Region(this,"UB3", CurrentBar - BarsRequiredToPlot - Displacement, 0, Upper, Lower, transparentBrush, FillBrush, Opacity, Displacement);
                            Paul H.NinjaTrader Customer Service

                            Comment


                              #15
                              Thank you for confirming.

                              I have an indicator attached that can be used for testing.

                              When used with nonequidistant bar spacing, there are additional glitches, see blue areas on the right side of the chart.
                              Attached Files

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by techgetgame, Today, 11:42 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post techgetgame  
                              Started by sephichapdson, Today, 11:36 PM
                              0 responses
                              1 view
                              0 likes
                              Last Post sephichapdson  
                              Started by bortz, 11-06-2023, 08:04 AM
                              47 responses
                              1,613 views
                              0 likes
                              Last Post aligator  
                              Started by jaybedreamin, Today, 05:56 PM
                              0 responses
                              9 views
                              0 likes
                              Last Post jaybedreamin  
                              Started by DJ888, 04-16-2024, 06:09 PM
                              6 responses
                              19 views
                              0 likes
                              Last Post DJ888
                              by DJ888
                               
                              Working...
                              X