Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Possible to create radio button in strategy parameters

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

    Possible to create radio button in strategy parameters

    Hi!

    I've done quite a bit of searching but I'm not having any luck finding an answer.

    Is it possible to create a simple radio button group (either or) in the strategy parameter section?

    For example, I currently have two boolean variables that create checkboxes when I run the strategy.

    [NinjaScriptProperty]
    [Display(Name="Use stop loss", Order = 1, GroupName=" Sell Parameters")]
    public bool useStopLoss
    { get; set; }

    [NinjaScriptProperty]
    [Display(Name="Use profit chase", Order = 2, GroupName="Sell Parameters")]
    public bool useProfitChase
    { get; set; }

    Is there any simple way to make these two choices mutually exclusive so that only one or the other can be selected and not both at the same time?

    Thanks!

    #2
    Hello InfraredBusa,

    I'm not aware of a way to get radio buttons, but you can use an enum instead and select a value from a drop-down.
    https://ninjatrader.com/support/help...ned_parame.htm

    Using bools, you can change the value or disable a value with a custom type converter.
    https://ninjatrader.com/support/help...r_to_custo.htm
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you so much! These answers look like they will work nicely!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by bubblegum, Today, 12:00 AM
      0 responses
      1 view
      0 likes
      Last Post bubblegum  
      Started by eseorvuda, Yesterday, 10:28 PM
      0 responses
      1 view
      0 likes
      Last Post eseorvuda  
      Started by ctrent, Yesterday, 09:58 PM
      0 responses
      4 views
      0 likes
      Last Post ctrent
      by ctrent
       
      Started by cxbnbvc, Yesterday, 09:25 PM
      0 responses
      2 views
      0 likes
      Last Post cxbnbvc
      by cxbnbvc
       
      Started by Realsmooth3, Yesterday, 09:10 PM
      0 responses
      9 views
      0 likes
      Last Post Realsmooth3  
      Working...
      X