Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Changes don't take after compile

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

    Strategy Changes don't take after compile

    Support,

    Ok, a little difficult to reproduce, but here are the symptoms. (if this has been posted, I apologize, I just couldn't find anything close to this).

    While working on a strategy (strategy is opened in both strat tab and also you have it open for editing), you make a change, you compile, then test.

    Well what seems to happen over time is that you can't be assured that the changes you make will take after you compile. It's making debugging a living hell because you don't know if it's your code, or if the compile didn't take or if it did, it is not reflecting because you are working off a cached version or something. It's just dirty.

    When I shut down NT and restart, then run strategy, the changes seem to take and run as expected.

    No errors in logs. No compile errors. This seems like dirty cache or something.

    I am not certain I am explaining it right, but the short version is that I can't trust my code change after compile unless I shutdown NT and restart. Granted, it will seem to work for a while, but then I notice that no trades fire, or something else which tells me that somethings not right.

    I narrowed this down because I essentially ended up commenting out my whole strategy less a line that triggers an order if high is greater than close, lol. It still didn't fire an order. After I shutdown NT and started, went right to the strat, and orders fired like wildfire. So it's a cache something or other in my non-technical opinion.

    Regards,

    #2
    r2krtrader, do you see the same when working with on a chart: after you complied the strategy fresh, please hit F5 to reapply the just changed strategy new so changes could take efffect - does the issue persist in this case?

    Comment


      #3
      Bertrand,

      Thank you for the reply.

      The issue is relating more to the fact that while working on NT for a period of time and changing, compiling, rewinding replay tape, etc., the strategy changes which I compiled, do not even take. I actually have to close down NT and restart.

      As it relates to charts, I don't start strategies from charts. I try to avoid extra baggage which isn't specific to a strategy. In other words, less moving parts, less problems. More of a gray box kind of trader I suppose. There is another issue related to charts refreshing, but that is more in relation to drawing (indicators painting, etc.) and actual candles appearing. Based on my experience thus far with the charts, it's best to wait some time before even attempting any serious testing. There are many other users who use Charts and seem to be reporting a great deal more than I can offer. Between constant red x'ed screens, data not drawing, and indicators not painting, and finally my favorite, having to reset all the parameters for indicators that use an indicator value as a dataseries (e.g. SMA(RSI(20), 20)) anytime you restart market replay or open the workspace. In other words, there are so many issues, I don't even know where to begin, so I decided to just be patient. I know NT will get it right and make it tight.

      So to answer your question:
      I am afraid to use charts. In order to try what you are saying, AND reproduce the issue, I would need to use charts and "wait" for the problem to occur. This means probably never getting the problem to occur because I will have chart crashing causing me to reboot NT before the strategy caching issue to occur.

      I have worked with other NT developers and many are sharing the same issues with the caching of strategies and compiling issues. Not sure where to look, but the symptoms are that you work with a strategy, make changes, and then you will find that your strategy is not acting on those changes. After you "catch" this, then you shut down NT and start it again, and sure enough the changes you made are "acted" upon or rather being reflected as you expected.

      I learned this the hard way after commenting out nearly 90% of my strategy code, lol. Then rebooted NT and my trades started to fire.

      Again, to be clear, I may be describing this wrong, or pointing to the wrong place, but the problem is defintely pointing toward a bug. Cached data would seemingly be the culprit. Or something else cracked "unlinking" the code in some way, etc. So I will defer to the talent and await further instruction!



      Regards,

      Comment


        #4
        r2ktrader, thanks for clarifying the issues, I'll try reproducing here when working from the strategies tab exclusively.

        For the other issues you ran into, please forward us trace and logs via Help > Mail to Support if possible so we may check into those, too.

        Comment


          #5
          r2ktrader, following steps seem to work well for me here -

          1. Apply strategy in tab

          2. Code changes in

          3. Compile

          4. Disable running strategy

          5. Reenable 'halted' strategy to create new instance

          6. Changes as coded in in step 2 are applied as expected
          Last edited by NinjaTrader_Bertrand; 02-19-2010, 12:32 PM.

          Comment


            #6
            Betrand,

            It has less to do with enable/disable of strategy as it does to do with changing code, compile, rewind tape (which resets strategy as it should), then no action as expected. (no errors).

            Mind you this is usually after a few hours of doing this, so it's not going to straight forward reproduce. But it's clearly a bug based on what I am hearing from some other NT traders with like-kind issue.

            I can't get much more into this than I already have. I would only suggest investigating this area. I am sure others have run into this. For now, when it breaks, I reset. That's the work around.

            Originally posted by NinjaTrader_Bertrand View Post
            r2ktrader, following steps seem to work well for me here -

            1. Apply strategy in tab

            2. Code changes in

            3. Compile

            4. Disable running strategy

            5. Reenable 'halted' strategy to create new instance

            6. Changes as coded in in step 2 are applied as expected

            Comment


              #7
              Update

              Betrand,

              It just happened again. Here is some more findings.

              After the said situation occurred, I put up my output screen and watched for my prints to show up. They only showed up when I clicked enable/disabled while the replay was running. BUT they would only show up for one iteration.

              So if I sat there and clicked and unclicked enable/disable, then the output would spit out, but when left alone, it just was stale, nothing happened (even is strategy enabled).

              I closed NT, opened, started replay, added strategy with same settings, and sure enough output from prints were showing up in output screen.

              I don't know if this helps, but it happened after many updates and changes / compiles in my strategy.

              You might be able to reproduce if you change compile, change compile, start restart. It could take 30/40 changes before you see symptoms, but defintely something here. Please let me know what you see on your side.

              Thanks

              Comment


                #8
                r2ktrader, thanks for the update provided - I'll keep an eye out here, though to clarify - it's expected you would need to start a new instance of the running strategy to use the modded version including latest custom code changes. This is essentially the same as hitting F5 on the chart to start a new NinjaScript instance of loaded objects.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                598 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                343 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                103 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                556 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                555 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X