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

Hide or show some properties based on another properties value

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

    Hide or show some properties based on another properties value

    Hello,

    I'm developing a strategy and since there are a lot of potential user defined variables, I want to keep things as much clean and organized as possible.
    What I'm trying to achieve is to hide or show some properties based on a boolean:

    Example:

    Click image for larger version

Name:	image.png
Views:	91
Size:	4.1 KB
ID:	1262693

    I want to hide the Long Entry Line and Short Entry Line variable IF Calculate on given price is false. The moment I turn Calculate on given price​ to true those two variables should pop up.
    Searching the documents and other topics here on the forum, I have come across the [RefreshProperties(RefreshProperties.All)] and [Browsable()] attribute and tried to "dynamically" change that, but I couldn't get it to work.

    I have some coding experience but I have never worked with attributes like this and the documentation on Attributes is very small, so any help on the matter is well appreciated

    ​​​​​​​Thanks for your help

    #2
    Hello zSucco,

    Thank you for your post.

    I recommend checking out the following reference sample script:Use case Home in that script shows how to toggle if properties are shown/hidden based on a bool checkbox. You may search the script for "use case #1" and jump to different comments and regions of code that are relevant to that use case. This information should be exactly what you are looking to achieve.

    Please let us know if we may be of further assistance.
    Emily C.NinjaTrader Customer Service

    Comment


      #3
      Hello Emily,

      Thank you for your help, I'll get an in depth look as soon as I can, I'll get back to you

      Have a good day

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by StockTrader88, 03-06-2021, 08:58 AM
      46 responses
      4,099 views
      3 likes
      Last Post tradgrad  
      Started by usasugardefender, Today, 01:42 AM
      0 responses
      1 view
      0 likes
      Last Post usasugardefender  
      Started by haas88, 03-21-2024, 02:22 AM
      15 responses
      182 views
      0 likes
      Last Post haas88
      by haas88
       
      Started by brianfnoel, Today, 01:24 AM
      0 responses
      6 views
      0 likes
      Last Post brianfnoel  
      Started by bill2023, Yesterday, 08:21 AM
      2 responses
      14 views
      0 likes
      Last Post bill2023  
      Working...
      X