Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Shadows created by DrawRegion

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

    #16
    Harry, looking at your code this issue seems to be related to pivots plot value being reset on the first bar of the session, hence the DrawRegion would have the Close price value at this point, this is what you see visualized.
    BertrandNinjaTrader Customer Service

    Comment


      #17
      That is correct. How can I draw regions that look correct then?

      If I reset -> does not work
      If I set to zero -> does not work, the speech balloon will point to zero

      So whatever I do, no correct region is drawn between two horizontal lines or even other data series, if these are session related. Reset() should do the trick and tell DrawRegion() not to draw.

      Comment


        #18
        Have now replaced DrawRegion() with DrawRectangle(). The latter method plots properly, as opposed to DrawRegion(). With ZOrder set to -1, rectangles plot nicely behind price.

        Comment


          #19
          Great idea, Reset would only apply to the plot for visualization purposes. I believe as workaround a unique DrawRegion for each day would help.
          BertrandNinjaTrader Customer Service

          Comment


            #20
            New problem:

            Indicator plots text via customized plot and draws a rectangle. How can I convince the indicator not to plot the filled rectangle on top of the text?
            Last edited by Harry; 08-17-2010, 01:08 PM.

            Comment


              #21
              There seems to be a bug in DrawRectangle() as it draws over the right margin of the chart.

              DrawRegion() does not draw over the right margin, but has the Baloo look.

              So both have bugs. See chart attached.
              Attached Files

              Comment


                #22
                I had used unique DrawRegions for each day (different tags), did not help at all.

                Originally posted by NinjaTrader_Bertrand View Post
                Great idea, Reset would only apply to the plot for visualization purposes. I believe as workaround a unique DrawRegion for each day would help.

                Comment


                  #23
                  Decoration

                  And by the way there are other DrawMethods that draw nice and useless pictures on the right margin....

                  See chart below.
                  Attached Files

                  Comment


                    #24
                    Further strange finding

                    Further finding:

                    DrawRegion plots behind the lines and text, Draw Rectangle plots above the lines and text. Why is that?

                    Comment


                      #25
                      Had to go back to the Baloo - Speech Balloon look of DrawRegion().

                      Reason: DrawRectangle() covers recklessly all bars and lines, where as DrawRegion() stays politely behind.

                      I would like to know why all of these Draw Functions are coded in a different way. There seems to be no logic behind the design, but they just seem to work at random. Some draw behind other indicators, other above. Some react to the initialization with ZOrder = -1, others don't. Some draw on the right margin of the chart, some don't.

                      Does this follow any concept?

                      Comment


                        #26
                        Only solution might be to write two indicators.

                        Indicator 1 plots the lines and the text.

                        Indicator 2 plots the filled ranges by using DrawRectangle() and by referencing indicator 1. The second indicator would be initialized with ZOrder = -1, so the rectangles will hopefully plot behind the rest of the chart.

                        Just would need to reference a BoolSeries ("plot" or "do not plot"), two DataSeries containing the upper and lower range and one DataSeries containing the sessionCount to create the tags.

                        Would this work?

                        Comment


                          #27
                          Harry, sorry for my late reply - I'll check into the default ZOrders assigned in our Draw methods.

                          Yes, the 2 indicators should do it, ZOrder -1 worked well in my test to default the DrawRectangle behind the price bars.
                          BertrandNinjaTrader Customer Service

                          Comment


                            #28
                            I coded a second indicator now. I can handle the drawing problem with this. The separate indicator catches the DataSeries from the other indicators, calculates the rectangles and plots them behind price and the lines of the other indicators.

                            However there is a new problem, now. If I call the pivots indicator in DailyBars mode, it does not work. For example


                            PHP Code:
                            double mainpivot 0
                            mainpivot Pivots(PivotRange.Daily,HLCCalculationMode.DailyBars,0,0,0,20).PP.Get(CurrentBar); 
                            always returns the value 0, whereas

                            PHP Code:
                            double mainpivot 0
                            mainpivot Pivots(PivotRange.Daily,HLCCalculationMode.CalcFromIntradayData,0,0,0,20).PP.Get(CurrentBar); 
                            works correctly.

                            Any help would be appreciated, just trying to draw clean rectangles behind price.

                            Comment


                              #29
                              Harry, with which data feed are you working? Would it provide native daily bars to calc those pivots in the daily data mode?
                              BertrandNinjaTrader Customer Service

                              Comment


                                #30
                                I use Kinetick data for EOD and Interactive Brokers for Intraday Data.

                                I tested this while being not connected -> no access possible,

                                Originally posted by NinjaTrader_Bertrand View Post
                                Harry, with which data feed are you working? Would it provide native daily bars to calc those pivots in the daily data mode?

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by FAQtrader, 04-25-2024, 12:00 PM
                                6 responses
                                95 views
                                0 likes
                                Last Post blkbird
                                by blkbird
                                 
                                Started by bee1943, Today, 09:55 AM
                                0 responses
                                7 views
                                0 likes
                                Last Post bee1943
                                by bee1943
                                 
                                Started by giulyko00, Yesterday, 11:49 AM
                                4 responses
                                24 views
                                0 likes
                                Last Post giulyko00  
                                Started by NUVERSA, Today, 09:31 AM
                                1 response
                                10 views
                                0 likes
                                Last Post NinjaTrader_BrandonH  
                                Started by rene69851, 05-02-2024, 03:25 PM
                                2 responses
                                29 views
                                0 likes
                                Last Post NinjaTrader_Kimberly  
                                Working...
                                X