Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 truepenny, Today, 03:45 AM
    4 responses
    20 views
    0 likes
    Last Post truepenny  
    Started by nightstalker, 05-04-2024, 02:05 PM
    4 responses
    45 views
    1 like
    Last Post Leeroy_Jenkins  
    Started by Drone360x, Today, 10:27 AM
    0 responses
    3 views
    0 likes
    Last Post Drone360x  
    Started by NUVERSA, Today, 10:08 AM
    2 responses
    12 views
    0 likes
    Last Post NUVERSA
    by NUVERSA
     
    Started by truepenny, Today, 03:59 AM
    5 responses
    22 views
    0 likes
    Last Post truepenny  
    Working...
    X