Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ChartObject Text

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

    ChartObject Text

    Hello,

    I want to ask why a simple indicator calculating the current price from priorday close and currentday open causes such a high value in the utm. Please see the attached screenshot. I have it on 8 instruments and in the code I have for the text

    Draw.TextFixed(this,"str8",str8, TextPosition.BottomLeft,Brushes.Black, new SimpleFont ("Arial",12), Brushes.White,Brushes.White,100);

    Should there be made changes to reduce the value shown in utm? (but I need the background color because with only black numbers its sometimes not good to see in the chart)

    Thank you!
    Tony
    Attached Files

    #2
    Hello tonynt,

    Thanks for your post.

    TextFixed drawing objects will display under "Fixed Text" in the NinjaScript Utilization Monitor.

    All Text drawing objects (Draw.Text) will be grouped into the "Text" ChartObject. If you have a script that draws a lot of text on the chart, you will see the "Text" ChartObject take additional CPU because the text that is added is taking CPU time.

    You can reduce the number of indicators that are drawing text with Draw.Text to decrease the CPU load, or you can modify those indicators so less Text is drawn with Draw.Text.

    The Utilization time is relative to how long the window has been open, so a high number may not necessarily mean you have lagging symptoms. I would recommend studying the Utilization Monitor if you have lagging symptoms, and then you can use the Utilization Monitor as a guide to see which components you can change/reduce/remove to get more performance out of the platform.

    ​​​​​​​We look forward to assisting.

    Comment


      #3
      Originally posted by tonynt View Post
      Draw.TextFixed(this,"str8",str8, TextPosition.BottomLeft,Brushes.Black, new SimpleFont ("Arial",12), Brushes.White,Brushes.White,100);
      Cache the font.

      Comment


        #4
        Originally posted by bltdavid View Post

        Cache the font.
        Hello,

        thank you for your reply. What means "cache the font" please or how to do.

        Thank you!
        Tony

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        83 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        45 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        65 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        68 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        56 views
        0 likes
        Last Post CarlTrading  
        Working...
        X