Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawText Some Times Gets Hidden By Scaling

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

    DrawText Some Times Gets Hidden By Scaling

    Sometimes the text from my DrawText methods are hidden by being out of range for the current scaling while in auto scaling mode. Is there a way to prevent this?

    thanks,
    taddypole...

    #2
    Hello Taddypole,

    Thanks for your note.

    The DrawText will need to also be included with the autoscale.

    If this is drawn manually on a chart:
    • Right-click the text drawing object -> select Properties
    • Check the box labeled Auto scale


    If this is from an indicator or strategy, set auto scale to true in the method overloads:
    Code:
    DrawText("myTextObject", [B]true[/B], "Printed Text", 10, Low[0] - 2 * TickSize, 0, Color.Black, new Font("Arial", 12.0f), StringAlignment.Center, Color.Black, Color.White, 10);

    Please let me know if this does not resolve your inquiry.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks ChelseaB,

      I've checked and the DrawText indicator is using AutoScale = true.

      Comment


        #4
        Hi Taddypole,

        Originally posted by Taddypole View Post
        I've checked and the DrawText indicator is using AutoScale = true.
        Does this mean that the indicator has Auto scale set to true in the parameters for the indicator on the chart or does this mean that you have looked at the indicator's code and have seen the DrawText() call and verified it is using true as the auto scale value.

        If the DrawText() call has the auto scale set to false, this textbox will not be included with the auto scale even if the indicator has the parameter for Auto scale set to true.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          The DrawText funciton is below:

          DrawText("HNV2Text"+ CurrentBar, true, "N2",1, negVolumeList.Keys[1], -30, Color.DarkRed, textFontBold, StringAlignment.Center, Color.Transparent, Color.Black, 0);

          This indicator is in Panel #2.
          Panel #2 scaling is set to automatic. If I adjust the scaling manually, I can bring the text into view.

          I'm uploading two images. One is Half Hidden and the other is Text In View.

          In the Text in View, i've unlocked the AutoScaling of panel to see the full text.

          I just don't understand why this would be happening.

          Thank you ChelseaB...
          Attached Files

          Comment


            #6
            Hello Taddypole,

            I do not think this is the correct call for the text that is in your screenshot.

            The text string, position, and colors are different. The auto scale could possibly be different as well.

            Please send the code for the call that draws this particular text box. The text string will be "P1".
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              yes.. you are correct ChelseaB,
              I did send the wrong one...

              But I did check all my DrawText's and they are all set for AutoScale = true.

              DrawText("HPV1Text"+ CurrentBar, true, "P1",1, posVolumeList.Keys[3], 35, Color.Lime, textFontBold, StringAlignment.Center, Color.Transparent, Color.Black, 10);

              Comment


                #8
                Hi Taddypole,

                May I have a slimmed version of this to test with on my end?

                To export your script do the following:
                1. Click File -> Utilities -> Export NinjaScript
                2. Enter a unique name for the file in the value for 'File name:'
                3. Select the strategy from the objects list on the left -> click the right facing arrow ">" to add the strategy to the export
                4. Click the 'Export' button -> click 'yes' to add any referenced indicators to the export -> click OK to clear the export location message


                By default your exported file will be in the following location:
                • (My) Documents/NinjaTrader 7/bin/Custom/ExportNinjaScript/<export_file_name.zip>


                Below is a link to the help guide on Exporting NinjaScripts.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  This indicator is an adaption of the Gomi DeltaVolume indicator and you would need his package installed to use it. If that is not possible, then it seems it would not be possible to strip out a slimmed down version.

                  Sorry....

                  Comment


                    #10
                    Hi Taddypole,

                    In this case, I would like to setup a remote support session with you.

                    Please send in an email to support[at]ninjatrader[dot]com.

                    In the email, please let me know your phone number as well as a good time to contact you including the time zone.

                    Also, please write Attn: Chelsea #857862.

                    I look forward to receiving your email.
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      Hi Taddypole,

                      The issue with the textbox affecting the autoscale yet still being half hidden was the yPixelOffset.

                      The yPixelOffset will move the box from the reserved space for it on the chart. Currently yours is set to 35 above the textbox's reserved space.

                      Changing this to 0 will show the entire box.

                      DrawText("HPV1Text"+ CurrentBar, true, "P1",1, posVolumeList.Keys[3]+35, 0, Color.Lime, textFontBold, StringAlignment.Center, Color.Transparent, Color.Black, 10);
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        Thanks Chelsea,

                        I now understand how that all works.

                        I would like to put in a request for change though. I would like the autoscaling to account for the yPixelOffset.The yPixelOffset allows a fixed spacing between multiple DrawText objects and thus they don't over lap each other as the panel height is reduced.

                        thanks again,

                        taddypole...

                        Comment


                          #13
                          Hi Taddypole,

                          Thanks, thats a great suggestion!

                          I will forward this request to our development department. Once I have received a tracking ID for this request I will update you with this ID.

                          Thank you for your idea aimed at improving the NinjaTrader experience.
                          Chelsea B.NinjaTrader Customer Service

                          Comment


                            #14
                            Hi Taddypole,

                            Your suggestion has been submitted and accepted for consideration for a future NinjaTrader release by our product development team. We will be tracking this suggestion using ID #2399 in our system.
                            Chelsea B.NinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by bortz, 11-06-2023, 08:04 AM
                            47 responses
                            1,602 views
                            0 likes
                            Last Post aligator  
                            Started by jaybedreamin, Today, 05:56 PM
                            0 responses
                            8 views
                            0 likes
                            Last Post jaybedreamin  
                            Started by DJ888, 04-16-2024, 06:09 PM
                            6 responses
                            18 views
                            0 likes
                            Last Post DJ888
                            by DJ888
                             
                            Started by Jon17, Today, 04:33 PM
                            0 responses
                            4 views
                            0 likes
                            Last Post Jon17
                            by Jon17
                             
                            Started by Javierw.ok, Today, 04:12 PM
                            0 responses
                            12 views
                            0 likes
                            Last Post Javierw.ok  
                            Working...
                            X