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

Hiding/unhiding sections of code depending on the boolean value of a variable

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

    Hiding/unhiding sections of code depending on the boolean value of a variable

    Is there a guide available that I can take a look at that explain how to hide or unhide sections of inputs depending on a true or false of a variable? Or maybe a simple piece of code I can look at?

    For example you want to use an EMA trendline as a boolean checkbox. If this checkbox is set to true then some display options appear for color of the trend line, length of the EMA line, and displaying the plot on the chart. If the boolean checkbox is false then hide these input options.

    I'm not sure what exactly this is called but I saw it on an indicator and thought it was pretty neat to clean up some user input sections if they aren't being used.

    #2
    Hello Dezorys,

    There is a sample in the help guide that demonstrates that concept, it is a little more complex of a C# topic. What you are describing is modifying the property descriptor collection so the property grid adds or removes properties based on a value. The sample linked below has a section of that sample dedicated to using a bool to toggle other user inputs which is the part you would need to look at.

    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by TiffanyMiller, Today, 10:19 PM
    0 responses
    2 views
    0 likes
    Last Post TiffanyMiller  
    Started by JackyP, 07-25-2023, 08:39 AM
    2 responses
    311 views
    0 likes
    Last Post j4trdr
    by j4trdr
     
    Started by algospoke, 05-13-2024, 06:53 PM
    12 responses
    132 views
    0 likes
    Last Post algospoke  
    Started by psangram, Today, 06:35 PM
    0 responses
    4 views
    0 likes
    Last Post psangram  
    Started by Alaina19, Yesterday, 04:38 PM
    2 responses
    16 views
    0 likes
    Last Post Alaina19  
    Working...
    X