• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

int data can't be specified as negative

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

    int data can't be specified as negative

    Hi,

    I have a parameter in strategy that is a signed integer (int) , but then in strategy analyzer, i can't enter negative value in the optimize box, such as -4. Why is this? Any workaround?

    #2
    Hello ssg10,
    I am glad to help you.

    The integer(int) has a Minimum value assigned to it, like the int cannot be less than 1 etc.

    so a code will look like this

    Code:
    [Description("")]
    [GridCategory("Parameters")]
    public int MyInput0
    {
           get { return myInput0; }
           set { myInput0 = Math.Max(1, value); }
    }
    In the above code, the int value cannot be less than 1 (one).

    To change the same you just remove the Math.Max part. So a modified code of the above will be like

    Code:
    [Description("")]
    [GridCategory("Parameters")]
    public int MyInput0
    {
           get { return myInput0; }
           set { myInput0 = value; }
    }
    the above will let you put in any value.

    If you have coded the strategy via the wizard, then please edit the same. In the User Defined Inputs box, assign a value like -9999 (mind the minus) in the Min field of the said int parameter.

    Please let me know if I can be of any further help.

    Regards,
    Joydeep.
    JoydeepNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by lavalampmj, Today, 05:25 PM
    0 responses
    4 views
    0 likes
    Last Post lavalampmj  
    Started by Antares66, Today, 05:19 PM
    0 responses
    2 views
    0 likes
    Last Post Antares66  
    Started by jmneto, Today, 05:18 PM
    0 responses
    4 views
    0 likes
    Last Post jmneto
    by jmneto
     
    Started by Bobbyj78, Today, 02:21 PM
    2 responses
    14 views
    0 likes
    Last Post bltdavid  
    Started by EnveousColnago, Today, 02:10 PM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_Ariana  
    Working...
    X