• 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.
    Joydeep M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Ilpropio, Yesterday, 09:45 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_EricB  
    Started by sgordet, Yesterday, 10:31 PM
    1 response
    2 views
    0 likes
    Last Post NinjaTrader_EricB  
    Started by Revan, Yesterday, 05:44 PM
    1 response
    14 views
    0 likes
    Last Post NinjaTrader_Marco  
    Started by superg3, Yesterday, 07:57 PM
    0 responses
    4 views
    0 likes
    Last Post superg3
    by superg3
     
    Started by Longhornmark, Yesterday, 07:06 AM
    5 responses
    36 views
    0 likes
    Last Post nkhoi
    by nkhoi
     
    Working...
    X