Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Possible to stop NT from redrawing indicator?

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

    Possible to stop NT from redrawing indicator?

    I've noticed that an indicator will redraw in its entirety on each tick (COBC = false) when I insert a condition (like an oscillator crossing above 100 or below -100) using

    Plots[0].Pen.Width = 2;

    to alter the width when the condition is fulfilled.

    Besides the fact I only want the width altered when the condition = true, is there a way to stop the entire redraw, which probably would save a lot of CPU especially in an indicator like Market Profile which would be redrawing every letter of the profile on every tick?

    #2
    Tarkus,

    The Pen object is a Microsoft defined object as part of one of their drawing packages. Unfortunately I know of no way to make it not redraw.

    However, if you create 2 plots each with a different width and have each have the same values, you can set the color of them to transparent when you don't want either plot drawing. Please find a reference sample for changing colors below.



    Please let me know if I may assist further.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by Tarkus11 View Post
      I've noticed that an indicator will redraw in its entirety on each tick (COBC = false) when I insert a condition (like an oscillator crossing above 100 or below -100) using

      Plots[0].Pen.Width = 2;

      to alter the width when the condition is fulfilled.

      Besides the fact I only want the width altered when the condition = true, is there a way to stop the entire redraw, which probably would save a lot of CPU especially in an indicator like Market Profile which would be redrawing every letter of the profile on every tick?
      Not unless you are willing to override the Plot() method, and make it draw only the last 2 bars.

      Comment


        #4
        Put in a condition with variables to only change the width when needed.




        Originally posted by Tarkus11 View Post
        I've noticed that an indicator will redraw in its entirety on each tick (COBC = false) when I insert a condition (like an oscillator crossing above 100 or below -100) using

        Plots[0].Pen.Width = 2;

        to alter the width when the condition is fulfilled.

        Besides the fact I only want the width altered when the condition = true, is there a way to stop the entire redraw, which probably would save a lot of CPU especially in an indicator like Market Profile which would be redrawing every letter of the profile on every tick?

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CortexZenUSA, Today, 12:53 AM
        0 responses
        1 view
        0 likes
        Last Post CortexZenUSA  
        Started by CortexZenUSA, Today, 12:46 AM
        0 responses
        1 view
        0 likes
        Last Post CortexZenUSA  
        Started by usazencortex, Today, 12:43 AM
        0 responses
        5 views
        0 likes
        Last Post usazencortex  
        Started by sidlercom80, 10-28-2023, 08:49 AM
        168 responses
        2,265 views
        0 likes
        Last Post sidlercom80  
        Started by Barry Milan, Yesterday, 10:35 PM
        3 responses
        11 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X