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 force Reload of Addon Code

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

    How to force Reload of Addon Code

    I am experiencing an issue where if by chance I close a ATMStrategy out manually by hitting the wrong close (The one that disables my Strategy ) it seems to hose up my Static
    vars. If I reload ninjaScript on every Chart or remove and Reload It corrects the situation.
    So I would like to be able to focus in on what is going awry. Is there a specific way to
    force a reload of just the addon code which is only static var definitions.

    My confusion is that it is clear if you want to reload the indicators on a chart which chart to reload. But with an Addon It is not as clear to me.
    Last edited by JerryWar; 08-08-2017, 10:39 AM.

    #2
    Hello JerryWar,

    It is not suggested to use static variables/classes in NinjaTrader.

    A possible solution would be you could make a button which would reset these static variables as a means of manually controlling a reset.

    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Yeah , unfortunately for the immediate future I am kind of stuck with them until my code is further developed as there seems to be no acceptable way for me to communicate between my indicator and the strategy without them. The only alternative I have seen is to create another instance of my indicator within the strategy and that is just too much of a load. I hear what you are saying and I think I am seeing some of the issues. Unfortunately , I don't think a reset button will fix this issue.

      Comment


        #4
        check out the example posted on this thread

        Comment


          #5
          The sample at the link is the way I use them. But and there have been issues. But the usage is slowly going away as I combine all my code into one strategy script.

          Comment


            #6
            Originally posted by JerryWar View Post
            The sample at the link is the way I use them. But and there have been issues. But the usage is slowly going away as I combine all my code into one strategy script.
            I tried using statics for some interactions but it was flaky. What works for me is to use memory mapped files with an associated mutex for access and/or using disk files and updating the file modified time when one side wants to indicate it has flushed data to be read by the other side. other side keeps track of last modified time and watches for changes in timestamp.

            Comment


              #7
              Sounds like your using the Time stamp as a semaphore.

              Comment


                #8
                Originally posted by JerryWar View Post
                Sounds like your using the Time stamp as a semaphore.
                not sure if it constitutes a semaphore but at least the timestamp can be a modification flag.

                most of my shared logic is using Mutex and memory mapped files, only use files for a couple things with the timestamp flag.

                have found though i have to set it modified explicitly otherwise doesn't always update.

                thanks for the reply.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by TraderBCL, Today, 04:38 AM
                2 responses
                17 views
                0 likes
                Last Post TraderBCL  
                Started by martin70, 03-24-2023, 04:58 AM
                14 responses
                106 views
                0 likes
                Last Post martin70  
                Started by Radano, 06-10-2021, 01:40 AM
                19 responses
                609 views
                0 likes
                Last Post Radano
                by Radano
                 
                Started by KenneGaray, Today, 03:48 AM
                0 responses
                5 views
                0 likes
                Last Post KenneGaray  
                Started by thanajo, 05-04-2021, 02:11 AM
                4 responses
                471 views
                0 likes
                Last Post tradingnasdaqprueba  
                Working...
                X