Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CS1518 while porting indicator from Ninja 7 to 8

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

    CS1518 while porting indicator from Ninja 7 to 8

    Hi

    my previous NInja 7 code was something like this

    #region Properties

    [Description("balh")]
    [GridCategory("Parameters")]
    public int Aggression
    {
    get { return aggression; }
    set { aggression = Math.Max(1, Math.Min(3,value)); }
    }

    It doesnt compile in Ninja 8 like that.

    So i changed it to

    [Range(1, 3)]
    [NinjaScriptProperty]
    [Display(Name="Aggression", Description="Blah", Order=1, GroupName="Parameters")]
    public int aggression
    { get; set; }

    i still get that error. This is common with almost all the properties defined in the indicator. Would appriciate any help.
    Thanks!

    #2
    Hello sgkcfc,

    The range is between 1 and 3. Do you have a default value of 1 being assigned in State.DataLoaded?

    You have mentioned: "i still get that error. ". What is the error message you are getting? On what line is there? What is the code on that line?
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    157 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    307 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    244 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    346 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    176 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Working...
    X