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

Add(new Line with input parameters

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

    Add(new Line with input parameters

    Hello
    I have an indicator where I want to draw a line based on input parameters:
    Add(new Line(Color.Green, InputVariable, "MyLine"));

    The Add command can only be called in the initialize function. But it ignores the input values, it always takes the default values. Seems that initialization is executed first and then user input is read.
    Why? Seems quite strange.

    thanks

    #2
    Hello Beauregard,

    Lines added with the new line in Initialize() are not meant to be dynamic.

    If you want have lines be dynamic with a user defined input parameter, they will need to be setup as either a horizontal lines with DrawHorizontalLine(), or by setting a plot value to the input, like is done with the ConstantLines indicator that comes preloaded inside of NinjaTrader.

    http://www.ninjatrader.com/support/h...zontalline.htm
    JCNinjaTrader Customer Service

    Comment


      #3
      thanks for the fast answer.
      I have done it now with DrawHorizontalLine in the OnBarUpdate() method.
      The problem now: I have a chart and in panel 1 and in panel 2 the indicator values. The DrawHorizontalLine is done in the panel 1, but I want it in panel 2. I could not find any method to define this?

      Comment


        #4
        Hello Beauregard,

        You will want to set the DrawOnPricePanel to false inside of Initialize().

        http://www.ninjatrader.com/support/h...pricepanel.htm
        JCNinjaTrader Customer Service

        Comment


          #5
          thanks! it worked

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by kujista, Today, 06:23 AM
          0 responses
          1 view
          0 likes
          Last Post kujista
          by kujista
           
          Started by traderqz, Yesterday, 04:32 PM
          1 response
          10 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by f.saeidi, Today, 05:56 AM
          1 response
          4 views
          0 likes
          Last Post Jltarrau  
          Started by Jltarrau, Today, 05:57 AM
          0 responses
          4 views
          0 likes
          Last Post Jltarrau  
          Started by Stanfillirenfro, Yesterday, 09:19 AM
          7 responses
          52 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Working...
          X