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 CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      429 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      281 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      241 views
      1 like
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      328 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      290 views
      0 likes
      Last Post CarlTrading  
      Working...
      X