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

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
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thank you very much, it works perfect!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by MGHORBEL, Today, 06:25 AM
      1 response
      13 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by 1001111, Today, 01:35 AM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by tradingnasdaqprueba, Yesterday, 03:42 AM
      11 responses
      40 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by haas88, 03-21-2024, 02:22 AM
      14 responses
      178 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by Skifree, Yesterday, 11:41 PM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Working...
      X