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 cmoran13, 04-16-2026, 01:02 PM
    0 responses
    43 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    25 views
    0 likes
    Last Post PaulMohn  
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    163 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    98 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    158 views
    2 likes
    Last Post CaptainJack  
    Working...
    X