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:	161
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:	140
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 dcriador, Today, 12:06 PM
        0 responses
        10 views
        0 likes
        Last Post dcriador  
        Started by dcriador, Today, 12:04 PM
        0 responses
        6 views
        0 likes
        Last Post dcriador  
        Started by cutzpr, Today, 08:54 AM
        0 responses
        11 views
        0 likes
        Last Post cutzpr
        by cutzpr
         
        Started by benmarkal, Today, 08:44 AM
        0 responses
        23 views
        0 likes
        Last Post benmarkal  
        Started by Tin34, Today, 03:30 AM
        2 responses
        29 views
        0 likes
        Last Post Tin34
        by Tin34
         
        Working...
        X