• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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

        http://ninjatrader.com/support/forum...d.php?t=103388

        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 percma, Today, 02:51 AM
                1 response
                6 views
                0 likes
                Last Post NinjaTrader_ChristopherD  
                Started by Vincere, Today, 04:38 AM
                1 response
                4 views
                0 likes
                Last Post NinjaTrader_EricB  
                Started by trader_rick, Today, 04:02 AM
                1 response
                3 views
                0 likes
                Last Post NinjaTrader_ChrisSch  
                Started by Abilene, Today, 01:27 AM
                0 responses
                15 views
                0 likes
                Last Post Abilene
                by Abilene
                 
                Started by simjs, Yesterday, 08:11 PM
                1 response
                6 views
                0 likes
                Last Post NinjaTrader_ChrisSch  
                Working...
                X