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

Draw Region with two data series

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

    Draw Region with two data series

    Bollinger bands with draw region filled works fine with one data series, but if I add a second data series, the plots shift but the draw region filled zone does not shift. Is there a way to correct this or is it just a limitation of draw region?
    Attached Files

    #2
    Originally posted by ThatManFromTexas View Post
    Bollinger bands with draw region filled works fine with one data series, but if I add a second data series, the plots shift but the draw region filled zone does not shift. Is there a way to correct this or is it just a limitation of draw region?
    Maybe a result of the loss of equidistant spacing?

    Comment


      #3
      Originally posted by koganam View Post
      Maybe a result of the loss of equidistant spacing?
      Thanks for your reply.

      That causes the plots to shift.

      My question is .... is there a way to have the DrawRegion filled zone shift with the plots.

      Comment


        #4
        Is NinjaTrader Support on Holiday?

        Does NinjaTrader support still answer posts on this forum?

        Comment


          #5
          Originally posted by ThatManFromTexas View Post
          Thanks for your reply.

          That causes the plots to shift.

          My question is .... is there a way to have the DrawRegion filled zone shift with the plots.
          You would need to update this drawing object to have new values. Each drawing object has a "tag" that identifies it, and is used to reference that object.



          DrawRegion(string tag, DateTime startTime, DateTime endTime, IDataSeries series1, IDataSeries series2, Color outlineColor, Color areaColor, int areaOpacity)

          If the string "tag" is the same, calling this method can be used to overwrite an existing drawn object with a new one.

          Please let me know if I may assist further.
          Adam P.NinjaTrader Customer Service

          Comment


            #6
            Is Graphics.FillPolygon supported in NinjaTrader?

            Comment


              #7
              TM,

              We would not be able to provide support for this method, but you are free to use it if you feel this may help solve your problem.

              We can only support that in which we have documented in our help guide. Here is a complete listing:

              MatthewNinjaTrader Product Management

              Comment


                #8
                Originally posted by ThatManFromTexas View Post
                Bollinger bands with draw region filled works fine with one data series, but if I add a second data series, the plots shift but the draw region filled zone does not shift. Is there a way to correct this or is it just a limitation of draw region?
                ThatManFromTexas, do you draw those regions based on indicator plots or custom data series objects?
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_Bertrand View Post
                  ThatManFromTexas, do you draw those regions based on indicator plots or custom data series objects?
                  I originally plotted the bollinger bands and used DrawRegion to color the zones between the bands.That worked fine except it wouldn't show up when I used custom graphics in the background.

                  I rewrote it plotting the bollinger bands and replaced the DrawRegion with FillPolygon to color the zones between the bands. That solved the problem with the graphics conflict and worked correctly with one data series, but not with two data series.

                  So I can get 2 out of 3 things I want on one chart with more than one data series and 3 out 3 if I only use 1 data series.

                  I don't normally use two data series so my standard chart looks like the attached images. It adjusts the background and shading colors according to the trend.

                  Thanks for your support!
                  Attached Files

                  Comment


                    #10
                    Hello,

                    I must say the background on your charts is quite stunning, well done and can't say I have ever seen that done before.

                    Unfortunately any custom drawing method is unsupported as you're aware. If I had a hint for you here I would supply it but without getting deep into it I would not have a worthwhile suggestion for you here.

                    Am I correct these 3 screenshots are all working correctly? Perhaps if you supplied a screenshot of the problem scenario I might be able to give you something to work on or define in these screenshots where the exact problem is.

                    -Brett

                    Comment


                      #11
                      Originally posted by NinjaTrader_Brett View Post
                      Hello,

                      I must say the background on your charts is quite stunning, well done and can't say I have ever seen that done before.

                      Unfortunately any custom drawing method is unsupported as you're aware. If I had a hint for you here I would supply it but without getting deep into it I would not have a worthwhile suggestion for you here.

                      Am I correct these 3 screenshots are all working correctly? Perhaps if you supplied a screenshot of the problem scenario I might be able to give you something to work on or define in these screenshots where the exact problem is.

                      -Brett
                      As long as I only use 1 data series, everything works correctly. When the trend changes the background and the shading change in sync with the trend.

                      When I add a second data series the plots shift due to Equidistant = False, but the shading from FillPolygon does not shift.

                      If I use DrawRegion instead of FillPoly , the shading will shift with the plots, but won't show up with the graphical background.

                      Unless you have a suggestion , I will stick with just one data series.

                      Thanks for your efforts.
                      Attached Files

                      Comment


                        #12
                        Hello,

                        Only idea I might have is to revisit this setup:

                        If I use DrawRegion instead of FillPoly , the shading will shift with the plots, but won't show up with the graphical background.

                        Specifically is it not displaying due to z axis? Perhaps move the background to paint before the DrawRegion does?

                        -Brett

                        Comment


                          #13
                          Originally posted by NinjaTrader_Brett View Post
                          Hello,

                          Only idea I might have is to revisit this setup:

                          If I use DrawRegion instead of FillPoly , the shading will shift with the plots, but won't show up with the graphical background.

                          Specifically is it not displaying due to z axis? Perhaps move the background to paint before the DrawRegion does?

                          -Brett
                          I'm not familiar with Z axis.

                          Comment


                            #14
                            That is the 3rd dimension for 3d.

                            Such as a desk with a pile of papers on it, you cant see the papers that are below other papers due to z axis.

                            Thus you either program to put the last piece of paper you ant displayed last on the desk or specify the z axis manually which we don't support. If you I believe you you change the background to be drawn first before the DrawRegion it could work.

                            -Brett

                            Comment


                              #15
                              I have had the same problem. I use DrawRegion() a lot because it always stays behind the bars, whereas other draw methods draw on top of the line.

                              (1) Example: Pivot indicator with pivot range. ZOrder affects all plots of the indicator including DrawRectangle(), but DrawRectangle() always plots on top of the pivot lines and hides them. If I use DrawRegion() instead it politely plots behind.

                              (2) If I use an image file for the background of the plot, I have the same problem as ThatManFromTexas, that is the background plot hides all regions drawn, because DrawRegion() will plot behind the background plot.

                              (3) If I have two indicators on a chart that use DrawRegion() the region will be plotted behind the image drawn by the third indicator. ZOrder is completely ignored, as DrawRegion() always plots behind.

                              There should be a way to tell NinjaTrader, in which order the layers shall be plotted. ZOrder simply does not work for DrawRegion().

                              Originally posted by NinjaTrader_Brett View Post
                              Hello,

                              Only idea I might have is to revisit this setup:

                              If I use DrawRegion instead of FillPoly , the shading will shift with the plots, but won't show up with the graphical background.

                              Specifically is it not displaying due to z axis? Perhaps move the background to paint before the DrawRegion does?

                              -Brett

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by carnitron, 04-27-2024, 08:42 PM
                              2 responses
                              18 views
                              0 likes
                              Last Post carnitron  
                              Started by cmtjoancolmenero, 04-25-2024, 03:58 PM
                              13 responses
                              49 views
                              0 likes
                              Last Post cmtjoancolmenero  
                              Started by sgordet, Today, 10:40 AM
                              0 responses
                              2 views
                              0 likes
                              Last Post sgordet
                              by sgordet
                               
                              Started by RaygunWizzle, Today, 09:30 AM
                              2 responses
                              19 views
                              0 likes
                              Last Post bltdavid  
                              Started by Ashkam, Today, 09:28 AM
                              0 responses
                              15 views
                              0 likes
                              Last Post Ashkam
                              by Ashkam
                               
                              Working...
                              X