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 AaronKoRn, Today, 09:49 PM
        0 responses
        11 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Today, 08:42 PM
        0 responses
        10 views
        0 likes
        Last Post carnitron  
        Started by strategist007, Today, 07:51 PM
        0 responses
        11 views
        0 likes
        Last Post strategist007  
        Started by StockTrader88, 03-06-2021, 08:58 AM
        44 responses
        3,980 views
        3 likes
        Last Post jhudas88  
        Started by rbeckmann05, Today, 06:48 PM
        0 responses
        9 views
        0 likes
        Last Post rbeckmann05  
        Working...
        X