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

How to avoid settings to show on input parameters

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

    How to avoid settings to show on input parameters

    Hello ,

    I have some lines on an indicator on the Initialize section like :
    Add(new Line(Color.DimGray, level1 * lvlx, "Level 1"));

    How can avoid its parameters ( color, level value, etc ) to show on input parameters ?
    pmaglio
    NinjaTrader Ecosystem Vendor - The Indicator Store

    #2
    Unfortunately you cannot.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      I found a way ;

      Just adding the line at the end of the Initialize Section :
      LinesConfigurable = false;
      pmaglio
      NinjaTrader Ecosystem Vendor - The Indicator Store

      Comment


        #4
        Ah. I see that is what you meant. Misunderstood. Thought you meant change the Add() syntaxing. Glad you got it resolved.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Now I have another problem :
          My indicator changes line value each time user change timeframe ; ie: on 5 min timeframe, lvlx=5 using this code on Initialize Section :
          if (Bars.Period.Id == PeriodType.Minute )
          { lvlx = Bars.Period.Value; Print( " " + lvlx +" "+level1*lvlx ); }
          Add(
          new Line(Color.DimGray, level1 * lvlx, "Level 1"));
          But when changing timeframe, the lines dont change ( levels are printed correct )....Any idea of what Im doing wrong ?
          pmaglio
          NinjaTrader Ecosystem Vendor - The Indicator Store

          Comment


            #6
            That is correct. You cannot have any such logic in Initialize(). After your script is selected in the indicator dialogue, no changes can be made except through the interface can be made.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Is there any way to change lines positions from inside the code ?
              Something like Lines[0].Set( new value) ?
              pmaglio
              NinjaTrader Ecosystem Vendor - The Indicator Store

              Comment


                #8
                You can try Lines[0].Value = something, but this is not supported.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  That worked great !
                  Just adding Lines[n].Value = new value at OnBarUpdate() when CurrentBar==0 was enough..
                  Thanks Josh !
                  pmaglio
                  NinjaTrader Ecosystem Vendor - The Indicator Store

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by helpwanted, Today, 03:06 AM
                  1 response
                  11 views
                  0 likes
                  Last Post sarafuenonly123  
                  Started by Brevo, Today, 01:45 AM
                  0 responses
                  9 views
                  0 likes
                  Last Post Brevo
                  by Brevo
                   
                  Started by aussugardefender, Today, 01:07 AM
                  0 responses
                  5 views
                  0 likes
                  Last Post aussugardefender  
                  Started by pvincent, 06-23-2022, 12:53 PM
                  14 responses
                  242 views
                  0 likes
                  Last Post Nyman
                  by Nyman
                   
                  Started by TraderG23, 12-08-2023, 07:56 AM
                  9 responses
                  387 views
                  1 like
                  Last Post Gavini
                  by Gavini
                   
                  Working...
                  X