Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Dynamic lines?

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

    Dynamic lines?

    This is related to my question about dynamic configuration data. I am making an indicator with a configuration enum parameter that controls the type of information the indicator is based on.

    That means whether or not a center line should be plotted varies according to which choice the user makes.

    I Add the line in Initialize(), because it cannot be added any other time.

    Is there any way to remove the line after Initialize() is done -- i.e. once I know whether or not it is wanted? Is that what Lines[0].Dispose(); does?

    --EV

    #2
    EV, unfortunately you can't set / unset the lines added dynamically - you could try changing their color to transparent for when you don't need them visible.

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      EV, unfortunately you can't set / unset the lines added dynamically - you could try changing their color to transparent for when you don't need them visible.
      Sounds good.

      What does the Dispose() method do, anyway?

      Comment


        #4
        The Dispose generally would allow used resources to be cleaned up / garbage collected by .NET

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          EV, unfortunately you can't set / unset the lines added dynamically - you could try changing their color to transparent for when you don't need them visible.
          As I think further about this, I am worried about NT trying to scale the indicator plot to include the transparent line, even if the line is far removed from the value being plotted (thus compressing the indicator plot). So far I do not see that happening, but an not clear why not.

          I suppose that at worst I can set it transparent, and in OnBarUpdate() set the value each time -- that way the line will not affect the indicator scaling.

          --EV

          Comment


            #6
            The OnBarUpdate() line value set / reset should not be needed, as they would not be part of the AutoScale.

            Comment


              #7
              Originally posted by NinjaTrader_Bertrand View Post
              The OnBarUpdate() line value set / reset should not be needed, as they would not be part of the AutoScale.
              Ah ... thanks .. now I understand why such lines are not hurting anything as is.

              --EV

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              597 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              343 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              103 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              556 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              555 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X