Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

How to check that the indicator is already loaded?

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

    How to check that the indicator is already loaded?

    1) How to check that the indicator is already loaded?
    How to avoid 2 times to load the same indicator?

    2) How to close (exit, drop, delete) the indicator if a repetition is found?

    Maybe I can make a global variable?

    These questions are still relevant.
    Last edited by Udimuz; 05-27-2019, 11:29 AM.

    #2
    Hi Udimuz, thanks for your post.

    The GetType() method will give the type of the referenced object. You can check an existing loaded indicator's type against the newly created indicator's type and cancel the operation if the types match.

    Please let me know if I can assist any further.


    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thanks Chris.
      Can you also answer my second question?

      2) How to close (exit, drop, delete) the indicator if a repetition is found?

      And another question:
      Are there global variables? in Ninjascript
      Forgive me, I'm just learning.

      Comment


        #4
        Hi Udimuz, thanks for the follow-up.

        How to implement this would depend on exactly what your code is doing. Could you demonstrate why you need this?

        Yes, there are global variables in a sense. I made this post a while ago that shows how to set up a "global" double variable. It also implements a property changed event for other objects to subscribe to. The code would go inside of a .cs file within the "Addons" folder.

        I look forward to hearing from you.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          I add the indicator "Cow".
          But I don't need it if already open indicator "Shepherd".
          1) How can I find in the indicator "Cow" that the indicator "Shepherd" is already open? In the indicator "Shepherd" already has all the functions I need.
          2) How can I close the indicator "Cow" correctly?
          Application.Current.Shutdown() <== this does not completely remove the indicator. He remains on the list.
          I could not find it myself, even in the "GetType ()" method.
          My questions are still relevant.
          Sorry for my bad english.
          Last edited by Udimuz; 05-27-2019, 11:41 AM.

          Comment


            #6
            Hi Udimuz, thanks for your reply.

            If you are trying to remove indicators from a chart, that would not be possible through an indicator. The indicator adding/loading is a part of the NT user interface and core code that can not be viewed or modified. I would be able to submit a feature request if this is what you were looking to do.

            I look forward to your reply.
            Chris L.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Rapine Heihei, Today, 07:51 PM
            0 responses
            3 views
            0 likes
            Last Post Rapine Heihei  
            Started by frslvr, 04-11-2024, 07:26 AM
            5 responses
            96 views
            1 like
            Last Post caryc123  
            Started by algospoke, 04-17-2024, 06:40 PM
            6 responses
            49 views
            0 likes
            Last Post algospoke  
            Started by arvidvanstaey, Today, 02:19 PM
            4 responses
            11 views
            0 likes
            Last Post arvidvanstaey  
            Started by samish18, 04-17-2024, 08:57 AM
            16 responses
            61 views
            0 likes
            Last Post samish18  
            Working...
            X