Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Variable number of parameters depending on one of them.

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

    Variable number of parameters depending on one of them.

    Hi,

    I want to create an enum parameter in the Propierties region to select the number of Take Profits to use in my strategy. For example: Number of Targets like picture 1. Once I select 1 target, I need to see 2 more parammeters, if I select 2 targets I need to see 4 parammeters more and If I selct None, I don't see any parameter.

    #2
    Hello lju45,

    Thanks for your post.

    You can create a custom typeconverter to help with this. For a reference, please see the help guide and example here: https://ninjatrader.com/support/help...r_to_custo.htm

    I've also attached an example, based on a strategy, to assist. It has nothing in OnBarUpdate and is only to demonstrate functionality in the User Interface and provide a further example of the extensive coding needed to accomplish your goal.

    ExampleTypeConverterusingEnum.zip

    Comment


      #3
      Thank you very much, it works perfect!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      50 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      126 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      69 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X