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 NullPointStrategies, Today, 05:17 AM
    0 responses
    19 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    119 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    63 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    41 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    45 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X