Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawTextFixed(TextPosition.TopRight) not working

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

    DrawTextFixed(TextPosition.TopRight) not working

    Hi,

    NT7b18

    I'm using DrawTextFixed("tag","blabla",TextPosition.TopRight );

    The text is not aligned to the top line of the indicator panel but floats some where between the top and the 0 line of my MACD.

    The BottomRight is working correctly and text is placed in the right corner most bottom position possible.

    Wessel

    #2
    Wessel, just to clarify, are you using DrawTextFixed() from an indicator or a strategy? If in an indicator, you have DrawOnPricePanel = false?
    AustinNinjaTrader Customer Service

    Comment


      #3
      Hi,

      I'm using it on an indicator ( it's an adjustment of the standard MACD indicator )
      These are the flags that I enabled/disabled:

      CalculateOnBarClose = false;
      PriceTypeSupported = true;
      PaintPriceMarkers = false;
      LinesConfigurable = true;
      DrawOnPricePanel = false;

      I've attached a demo version of MACD (MACD_topRightTest.zip) which will simply calculate the slope of the Histogram and prints it either on the top right or the bottom right corner depending on the location of the Histogram. If the Histogram is >0 I place thetext BottomRight, and if the Histogram is <0 I place the text TopRight.

      Use the following stocks on a daily chart will give you a good overview of the text going every where except in the top or bottom corner.
      These stocks on a daily chart with end date 7-7-10
      COST: This one is working nice today. Text is placed correctly on the bottom right
      LIFE: Text is on the 0 line of the MACD
      ADBE: Text is halfway inside the histogram just below the 0 line of MACD
      SHLD: Correct working Text is on bottom right
      RIMM: Text is just below the 0 line of the MACD
      CELG: Text on the 0 line of the MACD

      Hope this is reproducible at your side.

      Thanks!
      Wessel
      Attached Files
      Last edited by Wessel; 07-08-2010, 03:24 AM.

      Comment


        #4
        Wessel, we'll take a look and get back to - thanks for providing the sample.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          I could reproduce - thanks again and we'll look into to find the cause.
          BertrandNinjaTrader Customer Service

          Comment


            #6
            Excellent you could reproduce.
            Looking forward for the fix ;-) thanks for taking it in.

            Wessel

            Comment


              #7
              Wessel,

              Unfortunately this is expected behavior. DrawTextFixed with TopRight puts the object on the top right, but with a fixed pixel offset from the very top of the panel. When your panel is small this fixed pixel offset may seem larger causing your object to get pushed down more than you expect. Please increase your panel vertical size to see this.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                Hi Josh,

                Thanks for your reply, I tried to re-size the vertical panel size and it still looks horrible ( sorry about that).
                For instance the label of the indicator which is in the topLeft corner is placed correctly all the time whatever size I set the vertical panel and is not traveling on its own through my indicator .

                What it looks like is that the TopLeft and TopRight are at the same level. Only the TopLeft needs to leave space for the indicator label something that is not needed for the TopRight.

                My suggestion is that the TopRight posistion will fix it self the same way the Indicator label does at the left side. That way it is producing expected behavior imho

                I'll give you some screen shots that are most crazy even with a large vertical size it still looks bad in my opinion and is not working or will have no use in the indicator panel as the text is way to low. Please see if you can persuide your programers to take a different approche for the TopRight and Alling it with the IndictorLabel and place it correctly in the TopRight corner and not somewhere floating



                Many Thanks Wessel
                Attached Files

                Comment


                  #9
                  Thanks for screenshots and suggestions Wessel, we'll add this to our feedback list.
                  BertrandNinjaTrader Customer Service

                  Comment


                    #10
                    DrawOnPricePanel on NT7 different behavior as in NT6.5

                    I've noticed a different behavior in NT7 then in NT6.5 when trying to Draw objects both in Price Panel and Indicator Panel.

                    Here is the code to test, drawing Text in Price Panel and Indicator Panel:

                    DrawOnPricePanel = true;
                    DrawTextFixed(
                    "0","DrawOnPricePanel = true",TextPosition.TopRight);
                    DrawOnPricePanel =
                    false;
                    DrawTextFixed(
                    "1","DrawOnPricePanel = false",TextPosition.BottomRight);
                    // without this statement, both DrawTextFixed goes to Indicator Panel
                    DrawOnPricePanel = true;

                    Result in this picture:
                    Click image for larger version

Name:	DrawOnPricePanel1.gif
Views:	1
Size:	24.3 KB
ID:	857514

                    But, if we remove the last statement: DrawOnPricePanel = true;

                    DrawOnPricePanel = true;
                    DrawTextFixed(
                    "0","DrawOnPricePanel = true",TextPosition.TopRight);
                    DrawOnPricePanel =
                    false;
                    DrawTextFixed(
                    "1","DrawOnPricePanel = false",TextPosition.BottomRight);
                    // without this statement, both DrawTextFixed goes to Indicator Panel
                    // DrawOnPricePanel = true;

                    Then the picture is like this:
                    Click image for larger version

Name:	DrawOnPricePanel2.gif
Views:	1
Size:	22.5 KB
ID:	857515

                    In NT6.5 it works fine. When we have a statement DrawOnPricePanel = true;
                    We Draw on PricePanel, after the statement DrawOnPricePanel = true;
                    It keeps the Text in both Panels, where NT7 removes the Text on Price Panel,
                    when we have the code for DrawOnPricePanel = true; without following it
                    with DrawOnPricePanel = true; statement.

                    This is annoying when we have a lot of statements to Draw on Indicator Panel, and have to place always the DrawOnPricePanel = true; at the end and I don't know if it is too much CPU time, when we have an indicator working in RealTime (CalculateOnBarClose = false).

                    Kind regards,

                    Comment


                      #11
                      DrawOnPricePanel is not supported for dynamically changing it true and false. It is only designed to work with one setting set in Initialize(). What "worked" in 6.5 was bugged and had many adverse consequences. 7 has rectified the bug and has put it back to the designed behavior of one setting for all draw objects. That being said, being able to choose some objects to be on price panel and some to be on indicator panel is on our feedback list.
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #12
                        I just have a very simple question (sorry if in wrong thread)
                        Using NT7 I am trying to draw text (or a diamond) in my strategy upon enter or exit of a position using:

                        DrawDiamond("My diamond" + CurrentBar, false, 0, 0, Color.Red);
                        DrawText("MyText" + CurrentBar, "", 0, 0, Color.Red);

                        however there is no output...nothing and no errors/logs... can you please help?
                        is there something that Im missing that I need to include at some point?

                        Thx!

                        Comment


                          #13
                          nightriderx, you will have to set a price that is visible on the charts instead of a price of 0. The objects are being drawn, they are just at a price of 0 so you aren't seeing them.

                          The first 0 in the code you posted is the bars ago value-that can stay at zero. As for the second one, please try changing it to a value of Low[0] or something like that:
                          Code:
                          DrawDiamond("my diamond" + CurrentBar, false, 0, Low[0] - 2 * TickSize, Color.Red);
                          AustinNinjaTrader Customer Service

                          Comment


                            #14
                            Thanks Austin,
                            But even with the adjusted 'y' (to different highs/low/prices) and the copied text you sent I still get absolutely nothing (other then the buy@ and sell@)
                            is there something else I am missing?
                            Thx!
                            Last edited by nightriderx; 07-16-2010, 02:35 PM.

                            Comment


                              #15
                              nightriderx, have you recompilied the script (right-click in the editor window and select compile) and then reloaded it on the chart (right-click the chart -> reload NinjaScripts)?
                              AustinNinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by llanqui, Today, 03:53 AM
                              0 responses
                              5 views
                              0 likes
                              Last Post llanqui
                              by llanqui
                               
                              Started by burtoninlondon, Today, 12:38 AM
                              0 responses
                              10 views
                              0 likes
                              Last Post burtoninlondon  
                              Started by AaronKoRn, Yesterday, 09:49 PM
                              0 responses
                              15 views
                              0 likes
                              Last Post AaronKoRn  
                              Started by carnitron, Yesterday, 08:42 PM
                              0 responses
                              11 views
                              0 likes
                              Last Post carnitron  
                              Started by strategist007, Yesterday, 07:51 PM
                              0 responses
                              14 views
                              0 likes
                              Last Post strategist007  
                              Working...
                              X