Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Property Indentation

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

    Strategy Property Indentation

    I have created a property for my strategy that allows the user the ability to change profit targets. See below pic. I want the two parameters with the red arrows to be indented and allow the user to enter values in them only if "Enable Changing Targets" is checked. Whenever "Enable Changing Targets" is not checked, the user will not have the ability to change values and I want the text to be hidden or grayed out (if possible). How do I do update my code to do this? I included my code below for reference. Thanks

    Click image for larger version  Name:	NinjaIndent.png Views:	15 Size:	5.8 KB ID:	1306140

    HTML Code:
    [NinjaScriptProperty]
            [Display(ResourceType = typeof(Custom.Resource), Name = "Enable Changing Targets", GroupName = "NinjaScriptStrategyParameters", Order = 3)]
            public bool ChangeTarget
            { get; set; }
            
            [NinjaScriptProperty]
            [Display(ResourceType = typeof(Custom.Resource), Name = "# of Ticks within to activate new target", GroupName = "NinjaScriptStrategyParameters", Order = 4)]
            public int TickRang
            { get; set; }
            
            [NinjaScriptProperty]
            [Display(ResourceType = typeof(Custom.Resource), Name = "Enter # of Ticks to set new target", GroupName = "NinjaScriptStrategyParameters", Order = 5)]
            public int NewTickTarget
            { get; set; }​
    Last edited by algospoke; 06-17-2024, 06:29 PM.

    #2
    Hello algospoke,

    Thank you for your post.

    I recommend checking out the following reference sample script:



    This script demonstrates 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.

    Please let us know if we may be of further assistance.​

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    87 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    132 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    65 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    118 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X