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 helpwanted, Today, 03:06 AM
        1 response
        5 views
        0 likes
        Last Post sarafuenonly123  
        Started by Brevo, Today, 01:45 AM
        0 responses
        7 views
        0 likes
        Last Post Brevo
        by Brevo
         
        Started by aussugardefender, Today, 01:07 AM
        0 responses
        5 views
        0 likes
        Last Post aussugardefender  
        Started by pvincent, 06-23-2022, 12:53 PM
        14 responses
        242 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        9 responses
        384 views
        1 like
        Last Post Gavini
        by Gavini
         
        Working...
        X