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

Show and Hide indicator

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

    Show and Hide indicator

    Hi Everyone,

    I am working on an indicator that marks my offer and demand zones, the zones are defined in different files according to the temporality, in this way I have a file for all the daily information, 4H, 1H, 15M, 5M 1M, sometimes For analysis I need to load the indicator twice on the same chart, is there any way to hide one and leave the other by creating a button?

    Here is an example

    Just Daily

    Click image for larger version

Name:	Chart - 1D.png
Views:	160
Size:	41.6 KB
ID:	1213685

    Daily and 4H, how can i create a button for Hide Daily or 4H?

    Click image for larger version

Name:	PrtScr capture.png
Views:	138
Size:	98.6 KB
ID:	1213686

    #2
    Hello MJGutierrez,

    Thank you for your post.

    So I may better assist you, please clarify what you mean by your question "is there any way to hide one and leave the other by creating a button?"
    Where would you like the button and what exactly are you looking for the button to do when clicked? I notice that you highlighted the "Visible" checkbox in one of your screenshots; are you looking to have a button that toggles that visible option or something else? When you have multiple instances of the indicator loaded on the same chart are they displaying different items visually?

    I appreciate your patience and look forward to your response.
    Emily C.NinjaTrader Customer Service

    Comment


      #3
      Hi Emily, thanks a lot for your answer, "I notice that you highlighted the "Visible" checkbox in one of your screenshots; are you looking to have a button that toggles that visible option or something else? When you have multiple instances of the indicator loaded on the same chart are they displaying different items visually?"

      Yes i am looking for a button to toggle the visibility of the indicator when i have multiple instances of the same, this because each instance loads a different .csv file

      Comment


        #4
        Hello MJGutierrez,

        Thank you for the clarification.

        This indicator is publicly available on our NinjaTrader Ecosystem website:The aforementioned indicator contains code that will toggle between show/hide all indicators on the chart, although this could be modified to include/exclude certain indicators. For example, you could modify lines 193-206 so that instead of checking if the indi.Name != "ABMar****penLine" you could customize the "Label" property for each instance of the indicator and check for DisplayName in the script like the following:

        if (indiSwitch)
        {
        if (indi.DisplayName == "Instance1")
        {
        indi.IsVisible = false;
        }
        }
        else if (!indiSwitch)
        {
        if (indi.Name == "Instance1")
        {
        indi.IsVisible = true;
        }
        }

        For more information about the DisplayName of an indicator:




        I believe that using the ideas shown in this code, you should be able to code a button that will toggle the IsVisible property for the indicators on your chart as desired.

        Please let me know if I can be of further assistance.

        The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
        Emily C.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by rbeckmann05, Yesterday, 06:48 PM
        1 response
        12 views
        0 likes
        Last Post bltdavid  
        Started by llanqui, Today, 03:53 AM
        0 responses
        6 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by burtoninlondon, Today, 12:38 AM
        0 responses
        10 views
        0 likes
        Last Post burtoninlondon  
        Started by AaronKoRn, Yesterday, 09:49 PM
        0 responses
        15 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Yesterday, 08:42 PM
        0 responses
        11 views
        0 likes
        Last Post carnitron  
        Working...
        X