Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Load indicator only once per chart window

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

    Load indicator only once per chart window

    Hello, how can I prevent the indicator from being added twice in my indicator code? I want it to be possible to load the indicator only once per chart window.

    Click image for larger version

Name:	Screenshot_3.jpg
Views:	329
Size:	22.6 KB
ID:	1167544
    sidlercom80
    NinjaTrader Ecosystem Vendor - Sidi Trading

    #2
    Hello sidlercom80,

    Thanks for your post.

    Can you clarify if this is a strategy that is adding the indicator?

    If not can you clarify the steps to recreate?

    Comment


      #3
      Hello _PaulH, it's a manually added indicator. I would like to prevent an indicator from being manually added to a chart several times. Can I do this via an attribute or similar?
      Click image for larger version

Name:	Screenshot_1.jpg
Views:	300
Size:	69.7 KB
ID:	1167584
      sidlercom80
      NinjaTrader Ecosystem Vendor - Sidi Trading

      Comment


        #4
        Hello sidlercom80,

        Thanks for your reply.

        There would be no way to prevent the indicator from being selected and added to the chart.

        The best we can suggest is to loop through ChartControl.Indicators in State.DataLoaded, and flip a bool that the indicator was already added, so that instance does nothing but informs the user it is a duplicate.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        57 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        78 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        41 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        101 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        61 views
        0 likes
        Last Post PaulMohn  
        Working...
        X