Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Why the deleted code still works?

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

    Why the deleted code still works?

    I noticed this for quite a while. The first time I notice this is the target profit taking. I set a target profit taking when creating the scipt using the wizard. After I created, I deleted or blocked those codes. However, when I run the script, it still runs. Then, I have to create a blank script and copy only the code I need.

    Recently, I noticed again. I have some code as log statement for debugging purpose. After debugging, I deleted them. However, after I compiled the program and run it again, those log content is still there. All these are happened in the initialization, and I noticed that the initialization runs several time when start to run the script.

    This make me really doubt about the stability of this software, and make me confused because I am not sure the program really runs my new code or not. Can anybody clarify on this issue? Or any fix? I am really tired of creating new blank script for each code change.

    #2
    atrader, I'm not sure I fully follow in which order you try to work your changes in - for the wizard you want to for example change your target value, compile the changes in and then reload working NinjaScript's by pressing F5 on the chart (or right click > reload NinjaScript).

    For the Initialize(), it's expected seing it called more than once, believe up to 3 times...

    Comment


      #3
      Thans, Bertrand! It does work as you indicated. I hoped that I asked this earlier. I spend months try to deal with this because I thought it is a little bug of the software. However, the way I uesed is deleting the stragedy in the chart, and click OK, and then add it again (newly compiled), then click OK. I think it should be the same as using reload. Anyway, I know that I should use reload now. Thanks again!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      152 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      87 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      131 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      127 views
      1 like
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      106 views
      0 likes
      Last Post CarlTrading  
      Working...
      X