Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    BertrandNinjaTrader Customer Service

    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
        BertrandNinjaTrader Customer Service

        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.
            BertrandNinjaTrader Customer Service

            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 michi08, 10-05-2018, 09:31 AM
              3 responses
              740 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by sightcareclickhere, Today, 01:55 PM
              0 responses
              1 view
              0 likes
              Last Post sightcareclickhere  
              Started by Mindset, 05-06-2023, 09:03 PM
              9 responses
              258 views
              0 likes
              Last Post ender_wiggum  
              Started by Mizzouman1, Today, 07:35 AM
              4 responses
              18 views
              0 likes
              Last Post Mizzouman1  
              Started by philmg, Today, 01:17 PM
              1 response
              9 views
              0 likes
              Last Post NinjaTrader_ChristopherJ  
              Working...
              X