Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

duplicate indicator detection

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

    duplicate indicator detection

    Debugging my indicator I sometimes find a duplicate thread of the same indicator as if Ninjatrader did not properly manage the cleaning once I do F5 on the chart. It may have to do with me recompiling the code.
    Is there a way for me to write a code to detect duplicate indicator. It would be important for me to guarantee the reliability of the overall system.
    Thank you.
    G

    #2
    Hello giogio1,

    It is not clear what you are asking here, are you saying that you mistakenly added two instances of the indicator to the chart and want to detect if there are two instances?

    Comment


      #3
      The two pictures show the issue that happens once in a while. I have an indicator named Monitorz that has been placed on one chart only and only once. I don't have two instances of this same indicator in the entire platform.
      Sometimes, I press F5 on the chart and even though I am making sure everything is terminated correctly a double thread of the same indicator appear. In the case of the attached pictures, the thread 39 is the one that should have died and the 92 is the legit one. if I press F5 again on the chart, 39 still remains and keep running and 92 get correctly replaced with a new thread, a different number. By pressing continue on Visual Studio it will keep alternating between 39 and 92 indicating that the 39 has been kept alive and running in the background although it does not longer appear on the chart's indicator list. In that list remains only the one corresponding to the thread 92.
      The issue appears once in a while and I could live with it but I should fix it. For that I only need to detect its existence, the existence of a double and take according actions.
      Best
      Gio




      Click image for larger version

Name:	2025-01-27 13_57_12-forum should be dead thread.jpg
Views:	96
Size:	526.5 KB
ID:	1332721 Click image for larger version

Name:	2025-01-27 14_02_20-forum good thread.jpg
Views:	99
Size:	525.3 KB
ID:	1332722

      Comment


        #4
        Hello giogio1,

        There wouldn't be any way to detect that from your code, NinjaTrader handles all of the threading internally. Its possible that something in your code may be causing that, you could simplify your code to try and locate what specific syntax is required to see that happen and then modify that code.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        558 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        324 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        545 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        547 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X