Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Performance considerations for 'FixedText'

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

    Performance considerations for 'FixedText'

    Hi,
    I have an indicator that plots 10-30 'FixedText' lines down the side of the screen. It does this on every bar. Sometimes more if mkt very active. I find that in my nijascript utilisation monitor, 'FixedText' 'ChartObject' is now one of the highest (the second) utilisation. I take care only to call Draw.TextFixed to update the objects when they list has changed (rather than blindly write it every bar, etc.). But, it seems a performance hog. I would use onrender, but the indicator already has a plot that uses onredner and as you cannot plot in the chart and indicator panes...

    So, the question is, are there any performance considerations for using Draw.TextFixed? The alternative is to separate out the draw functionality into another indicator and figure some way of them sharing the data, but this seems complex! I realised fixedtext objects have events etc tied to them. Not sure if there are undocumented ways to turn off things like this to increase performance? Any tips would be good. Perhaps updating the text/colours on the object would be faster than calling Draw.TextFixed with the same tag and overwriting, for instance?

    Thanks.
    Last edited by pjsmith; 10-13-2020, 08:51 AM.

    #2
    Hello pjsmith,

    Thank you for the post.

    In this case you would likely need to look at using a separate indicator if using OnRender is not going to be an option for the given use case. OnRender is really the best way to increase efficiency. The drawing objects are full C# objects and have underlying logic associated with them so any updates to those will have more overhead than simply re rending new data.

    If this happens to be a use case that includes a strategy, it would be fairly simple to coordinate having two indicators as you could have the strategy add them and control their placement. If the use case is simply an indicator that would make sharing more difficult as there is no specific way to share data between two active indicators.

    One option here may be to add a user input to the indicator, lets call it ToggleState. If ToggleState is true do your existing indicator plotting logic. If ToggleState is false you could run a second set of logic to render the text instead of plotting. This effectively creates two indicators but instead of being two totally separate indicators its the same logic leading to the same calculation. The only difference would be how you are displaying the data it calculated. That's just to avoid creating some type of sharing situation, just let the indicator do the same work it was doing and render differently.

    I look forward to being of further assistance.

    Comment


      #3
      Thanks. I'll go the data sharing route and build another indicator to plot the text via onrender, probably via a public class in an addon. The reason for this is adding another instance of the indicator, given it works with tick data, would likely impact performance more than the alternatives.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      650 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      370 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      109 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      574 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      577 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X