Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Property of Indicators.

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

    Property of Indicators.

    Hi. In the indicator, I enter a property of several variables. How to save settings? It is necessary that after each change of properties of value kept. When we call the indicator, the last settings were set automatically. How can do it?

    In code I have.

    protected override void OnStateChange()
    {
    if (State == State.SetDefaults)
    {
    TimeSeconds = 500;
    Ask_ = Brushes.Tomato;
    }

    [NinjaScriptProperty]
    [Range(1, int.MaxValue)]
    [Display(Name="Time MilliSeconds Dom", Description="Time.", Order=1, GroupName="1. Parameters")]
    public int TimeSeconds
    { get; set; }

    [NinjaScriptProperty]
    [Display(Name = "Ask", Description = "Grid.", Order = 1, GroupName = "2. Color")]
    public System.Windows.Media.Brush Ask_
    { get; set; }

    What should I add in code to save the settings after each property change?

    Thank you very much.

    #2
    Hello _Roman,

    The Brush will need to be serialized so the value may be stored as a string in the xml file for the workspace or the template.

    Below is a link to the help guide.


    The int, however does not need serialization as it naturally converts to a string, and will automatically be saved in xml files.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    566 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    330 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    547 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    548 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X