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

More Input Issues

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

    More Input Issues

    I have a strategy. I want to use inputs. I copied the property stmt for myInput0 which is automatically put in the strategy.
    I renamed the property statement to 'AtPrice' it is a double. It compiled fine.
    When I load it on a chart it freezes up (just like before). I now am in the same situation I was in before. I did not realize that what I did by copying the input statement would make the world come to an end.
    Do I have to reload NT again. Which means my workspace will need to be constructed again ..right??
    Please let me know how to code user inputs....
    Please help...
    Duke

    #2
    Hi Duke, for creating user input for scripts please see this tip here with the specifics needed - http://www.ninjatrader.com/support/f...ead.php?t=5782
    BertrandNinjaTrader Customer Service

    Comment


      #3
      NT won't load

      Apparently, I have really done some damage. I uninstalled MB Trading navigator and NT and reloaded both --- several times. I have rebooted. But each time NT loads then a msg pops up that asks if I want to send an error report. When I make a choice the entire app closes.

      Can you shed some light on this??
      Duke

      Comment


        #4
        Can you please contact me via Help > Mail to Support, so I could review your diagnostic files attached with this?
        BertrandNinjaTrader Customer Service

        Comment


          #5
          App won't load

          If the NT will not load I cannot send the email ... correct??

          Comment


            #6
            You can in this case still send over the files manually to us at support at ninjatrader dot com

            They are located in Documents > NinjaTrader 7 > log / trace and carry today's date each.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              I have NT up and running again. I did receive your email on how to do inputs. I am familiar with prop statements. Your instructions about setting up inputs did not include copying previous property statements. I do this to reduce typing then change variable names etc. However, (pls read my previous posts on this) the entire platform became inoperable when I did this, I copied the myInput0 which was generated by the platform when the strategy was first written.
              This time I will type them in (not copy). Pls let me (and others) know if there is something peculiar about what I did that would cause such an issue.
              Thank you....

              Comment


                #8
                Glad you're up and running again - did you by any chance create a recursive input? For example this will generate a warning when trying to compile : note the getter / setter do not use the private variable.

                [Description("Numbers of bars used for calculations")]
                [GridCategory("Parameters")]
                public int Period
                {
                get { return Period; }
                set { Period = Math.Max(1, value); }
                }
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  I did the following
                  #region Properties
                  [Description("")]
                  [GridCategory("Parameters")]
                  public int MyInput0
                  {
                  get { return myInput0; }
                  set { myInput0 = Math.Max(1, value)
                  ; }
                  }
                  public int Interrupt
                  {
                  get { return Interrupt; }
                  set { Interrupt = value; }
                  }

                  #endregion

                  The red code was copied from the green code and the variables were changed.
                  It compiled but the app shut down when I attached it to the chart.
                  Duke

                  Comment


                    #10
                    duke,

                    The Red code you use would be a recursive input

                    Notice the green code has the public int with MyInput0 capitalized, but the getter/settter is lowercase

                    You will need to ensure you're following this format to prevent issues with your custom code

                    Code:
                    public int Interrupt
                    {
                    get { return interrupt; }
                    set { interrupt = value; }
                    }
                    If the application still does not start, it's likely loading the workspace with this recursive property. To get the application to start, please navigate to (My) Documents\NinjaTrader 7\workspaces\ and delete the file named _Workspaces.xml

                    Then restart the program and you should be able to get it and change the code.
                    MatthewNinjaTrader Product Management

                    Comment


                      #11
                      Thank you, Matthew....
                      I keep forgetting about caps and noncaps in c#..
                      Another issue ---
                      I wanted to delete a strategy. I went in to edit strategy and deleted the strategy. This is a .cs document. Not the compiled version. I cannot create another strategy with the same name.
                      I notice that when I right click on the chart and select strategies that this strategy is still present.
                      It appears that there is a compiled version somewhere. I need to delete this.
                      Christopher has been working with me. So far nothing seems to work. Is there a location where the compilation resides?
                      Duke

                      Comment


                        #12
                        Duke,

                        I responded to your email in which you were working with Christopher.

                        You should be able to delete this in (My) Documents\NinjaTrader 7\bin\custom\Strategy\<your strategy name>.cs

                        After it has deleted, please compile your other indicators and it should be removed.
                        MatthewNinjaTrader Product Management

                        Comment


                          #13
                          It is still in my strategy list from my charts...

                          Comment


                            #14
                            Duke,

                            Can we please contain this to either this thread or the email chain.
                            MatthewNinjaTrader Product Management

                            Comment


                              #15
                              Originally posted by NinjaTrader_Matthew View Post
                              duke,

                              The Red code you use would be a recursive input

                              Notice the green code has the public int with MyInput0 capitalized, but the getter/settter is lowercase

                              You will need to ensure you're following this format to prevent issues with your custom code

                              Code:
                              public int Interrupt
                              {
                              get { return interrupt; }
                              set { interrupt = value; }
                              }
                              If the application still does not start, it's likely loading the workspace with this recursive property. To get the application to start, please navigate to (My) Documents\NinjaTrader 7\workspaces\ and delete the file named _Workspaces.xml

                              Then restart the program and you should be able to get it and change the code.
                              Nice catch. Thankfully I didn't get to test the code out and have issues too.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by DJ888, 04-16-2024, 06:09 PM
                              4 responses
                              12 views
                              0 likes
                              Last Post DJ888
                              by DJ888
                               
                              Started by terofs, Today, 04:18 PM
                              0 responses
                              11 views
                              0 likes
                              Last Post terofs
                              by terofs
                               
                              Started by nandhumca, Today, 03:41 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post nandhumca  
                              Started by The_Sec, Today, 03:37 PM
                              0 responses
                              3 views
                              0 likes
                              Last Post The_Sec
                              by The_Sec
                               
                              Started by GwFutures1988, Today, 02:48 PM
                              1 response
                              9 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Working...
                              X