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 Klaus Hengher, Yesterday, 03:13 AM
      2 responses
      15 views
      0 likes
      Last Post Klaus Hengher  
      Started by Sebastian - TwinPeaks, Yesterday, 01:31 PM
      2 responses
      13 views
      0 likes
      Last Post Sebastian - TwinPeaks  
      Started by wbennettjr, 07-15-2017, 05:07 PM
      16 responses
      2,530 views
      1 like
      Last Post eladlevi  
      Started by Human#102, Yesterday, 09:54 AM
      2 responses
      8 views
      0 likes
      Last Post Human#102  
      Started by Patlpp, 08-16-2021, 03:10 PM
      10 responses
      499 views
      0 likes
      Last Post Joerg
      by Joerg
       
      Working...
      X