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 CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    26 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    182 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    335 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    260 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X