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 jaybedreamin, Today, 05:56 PM
              0 responses
              2 views
              0 likes
              Last Post jaybedreamin  
              Started by DJ888, 04-16-2024, 06:09 PM
              6 responses
              18 views
              0 likes
              Last Post DJ888
              by DJ888
               
              Started by Jon17, Today, 04:33 PM
              0 responses
              1 view
              0 likes
              Last Post Jon17
              by Jon17
               
              Started by Javierw.ok, Today, 04:12 PM
              0 responses
              6 views
              0 likes
              Last Post Javierw.ok  
              Started by timmbbo, Today, 08:59 AM
              2 responses
              10 views
              0 likes
              Last Post bltdavid  
              Working...
              X