Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawText() and Autoscale

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

    DrawText() and Autoscale

    I am having an issue when using DrawText and setting the AutoScale to false. Could you folks test this on your end to determine if it is a "Me" issue or NT issue. The image included shows the issue. This is the code that I am using:

    #region Variables
    // Wizard generated variables
    private int myInput0 = 1; // Default setting for MyInput0
    private System.Drawing.Font textFont;
    #endregion

    protected override void Initialize()
    {
    Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
    CalculateOnBarClose = true;
    Overlay = true;
    PriceTypeSupported = false;
    textFont = new Font("Arial", 16 );
    }

    protected override void OnBarUpdate()
    {

    if (ToTime(Time[0]) == 151500 )
    DrawText( "test" + CurrentBar.ToString(),
    false,
    "Test Something",
    0,
    High[0] + 100 * TickSize,
    0,
    Color.Black,
    textFont,
    StringAlignment.Center,
    Color.Transparent,
    Color.Transparent,
    0);

    }



    Thanks. You guys are great.
    Attached Files

    #2
    Hello,

    What is it you are trying to accomplish? The issue is not apparent to me from your screen shot.
    DenNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Ben View Post
      Hello,

      What is it you are trying to accomplish? The issue is not apparent to me from your screen shot.
      The DrawText(....) command has the Autoscale variable set to false (see the Arrow Line in the image) yet when I open the Text Properties it is set to true (see the Arrow Line in the image). Also the text "Test Something" should not be visible as it is above the highest price bar .

      When I open the Text Properties and UnCheck the "Auto scale" it performs as expected. I don't have this issue with DrawLine, DrawArrowUp, DrawArrowDown, DrawRectangle when setting the AutoScale variable to true or false.

      That leads me to believe that POSSIBLY the DrawText command is not handling the AutoScale correctly or something is not working correctly on my computer. One or the other. That is the reason I ask if it could be confirmed as a "Me" issue or NT issue. I have tried everything that I can think of and have not found a solution to the problem.

      Comment


        #4
        Hello,

        I will have someone take a look at this on Monday. Thank you for your patience.
        DenNinjaTrader Customer Service

        Comment


          #5
          Now I am confused. Monday morning and I just started NT and the AutoScale is working as expected for the DrawText(...) command. Will watch and report. Maybe I was doing something wrong or it is an issue with my computer. Clueless at the moment.

          Comment


            #6
            Ok, thanks for reporting back - did you try this in a brand new chart and workspace? Do you see any errors in the logs if this happens? If it happends again, please reference this thread and send us your log and trace through the Help > Mail to Support feature - thanks!

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            581 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            336 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            103 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            554 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            552 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X