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 habeebft, Today, 07:27 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_ChristopherS  
        Started by AveryFlynn, Today, 04:57 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by Max238, Today, 01:28 AM
        4 responses
        37 views
        0 likes
        Last Post Max238
        by Max238
         
        Started by r68cervera, Today, 05:29 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by geddyisodin, Today, 05:20 AM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X