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 AttiM, 02-14-2024, 05:20 PM
        12 responses
        213 views
        0 likes
        Last Post DrakeiJosh  
        Started by cre8able, 02-11-2023, 05:43 PM
        3 responses
        237 views
        0 likes
        Last Post rhubear
        by rhubear
         
        Started by frslvr, 04-11-2024, 07:26 AM
        8 responses
        116 views
        1 like
        Last Post NinjaTrader_BrandonH  
        Started by stafe, 04-15-2024, 08:34 PM
        10 responses
        47 views
        0 likes
        Last Post stafe
        by stafe
         
        Started by rocketman7, Today, 09:41 AM
        3 responses
        11 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X