Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to implement code changes when AddOn developing?

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

    How to implement code changes when AddOn developing?

    Hello Support!

    I'm trying to develop AddOn in NT8 and have a problem.

    Each time when I wrote some code and compiled it I have to shut down the NT8 and start it againg to see whether my code works or not.

    Nothing changes when I just compile the code of my AddOn.

    Is there any way do not restart NT8 each time when I want to check the work of my AddOn?

    Regards.

    #2
    Hello,

    There is not an inherent limitation with AddOns that requires a restart -- in most cases, simply recompiling your script should do the trick. However, there are a few things which would require a restart, such as altering visual elements throughout the platform via your AddOn. If your AddOn creates its own window, on the other hand, that would require you to at least close and re-open the window.

    Can you describe a bit about what your AddOn is doing? I should be able to provide more guidance if so.
    Dave I.NinjaTrader Product Management

    Comment


      #3
      Hello Dave --

      thank you for the reply.

      I work with sample from here


      each time when I change functionality of the button click I have to restart the platform to apply the changes.

      Also I put textblock control instead of the button and I have to restart the platform either.

      Regards.

      Comment


        #4
        Hello alex_bbfg,

        I will be investigating this further and will return with my findings.

        Thank you for your patience.
        Zachary G.NinjaTrader Customer Service

        Comment


          #5
          Hello alex_bbfg,

          Can you please provide an example of what functionality you have changed for the ExampleButtonClick? I have added additional prints and a PlaySound() and the button functioned as expected after compiling without needing to restart.
          Zachary G.NinjaTrader Customer Service

          Comment


            #6
            Hello ZacharyG --

            Here is the demonstration of the problem https://drive.google.com/open?id=0B9...U9OeXZ1NUFkWTg

            Also ther is a code file of my script attached.
            You know, one time the compilation had worked and the fuctionality changed, but only once.

            Regards.
            Attached Files

            Comment


              #7
              Hello alex_bbfg,

              Once you have made changes, you will need to close and reopen the chart. There is no need to restart the platform entirely.

              I have tested the changes you have shown in your example video.

              Do the changes you have made not take affect despite closing and opening the chart?
              Zachary G.NinjaTrader Customer Service

              Comment


                #8
                Hello ZacharyG,

                thank you for the reply.

                I tried to close and open a chart to check changes after compilation. It works but really strange.

                The order of action is the following.

                I make changes and compile the code. Nothing happens with the button.
                I close the chart and open it again. No any button on the chart.
                I compile the code again. The button appears on the chart with new functionality.

                I've found some errors about my AddOn. My be it helps.

                2016-01-26 10:08:03:564|3|4|AddOn 'DaysListScroll': Error on calling 'OnWindowCreated' method: System.InvalidOperationException: Вызывающий поток не может получить доступ к данному объекту, так как владельцем этого объекта является другой поток. в System.Windows.Threading.Dispatcher.VerifyAccess() в System.Windows.DependencyObject.GetValue(Dependenc yProperty dp) в NinjaTrader.Gui.Tools.NTWindow.get_MainMenu() в NinjaTrader.NinjaScript.AddOns.DaysListScroll.<OnW indowCreated>b__3() в System.Windows.Threading.Dispatcher.Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout) в System.Windows.Threading.Dispatcher.Invoke(Action callback) в NinjaTrader.NinjaScript.AddOns.DaysListScroll.OnWi ndowCreated(Window window) в NinjaTrader.NinjaScript.AddOnBase.<>c__DisplayClas s17_0.<NotifyCreated>b__0()


                Regards.
                Last edited by alex_bbfg; 01-26-2016, 10:26 AM.

                Comment


                  #9
                  Hello alex_bbfg,

                  Can you please provide the AddOn script that is producing this error?
                  Zachary G.NinjaTrader Customer Service

                  Comment


                    #10
                    ZacharyG,

                    the AddOn is attached in the #6 item of the thread. I think the error occurs somewhere between code changing, compilation and the chart closing and opening.

                    Regards.

                    Comment


                      #11
                      Hello alex_bbfg,

                      As a test, please exclude all custom NinjaScript items that you have from compilation, leaving your AddOn as the only custom item included in compilation.

                      To do this, open up the NinjaScript Editor. With the editor open, select all custom NinjaScript items, right-click, and select Exclude from Compilation.

                      Once you have done this, please compile and re-test your AddOn. Does the behavior still persist?
                      Zachary G.NinjaTrader Customer Service

                      Comment


                        #12
                        Hello ZacharyG,

                        Yes, the behavior still persist. The log line says

                        2016-01-26 10:08:03:564|3|4|AddOn 'DaysListScroll': Error on calling 'OnWindowCreated' method:

                        which is the name of my AddOn. So the error is in it.

                        Regards.

                        Comment


                          #13
                          Hello alex_bbfg,

                          I am unable to reproduce this with the version of the AddOn provided in this forum thread.

                          Can you please attach the latest version of your AddOn so I may test to see if I can reproduce this error?
                          Zachary G.NinjaTrader Customer Service

                          Comment


                            #14
                            Hello ZacharyG,

                            thank you for the help. The last version of my AddOn is attached.

                            However, I tried NT8 beta and it gives me lots of messages with exceptions, so decided to wait official release.

                            Regards.
                            Attached Files

                            Comment


                              #15
                              Hello alex_bbfg,

                              Thank you for the latest version of your script. However, I am still unable to reproduce this error on my end. It looks like the add on loads up fine and is displayed within the chart's tool bar.

                              Can you provide reproducible steps that cause this error to appear so I may test on my end?
                              Last edited by NinjaTrader_ZacharyG; 02-05-2016, 10:19 AM.
                              Zachary G.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Gerik, Today, 09:40 AM
                              2 responses
                              7 views
                              0 likes
                              Last Post Gerik
                              by Gerik
                               
                              Started by RookieTrader, Today, 09:37 AM
                              2 responses
                              11 views
                              0 likes
                              Last Post RookieTrader  
                              Started by alifarahani, Today, 09:40 AM
                              1 response
                              7 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by KennyK, 05-29-2017, 02:02 AM
                              3 responses
                              1,285 views
                              0 likes
                              Last Post NinjaTrader_Clayton  
                              Started by AttiM, 02-14-2024, 05:20 PM
                              11 responses
                              186 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Working...
                              X