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 funk10101, Today, 12:02 AM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Started by GLFX005, Today, 03:23 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Erick  
            Started by nandhumca, Yesterday, 03:41 PM
            1 response
            13 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by The_Sec, Yesterday, 03:37 PM
            1 response
            11 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by vecnopus, Today, 06:15 AM
            0 responses
            1 view
            0 likes
            Last Post vecnopus  
            Working...
            X