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

How to put a negative value in the Range attribute

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

    How to put a negative value in the Range attribute

    I am trying to put a negative number in a parameter but it keeps coming out zero. My Range looks like this:
    [Range(-5, 5)]
    [Display(Name="ExitTicks", Description="", Order=12, GroupName="Parameters")]
    public int ExitTicks

    I want to have a zero value where I can calculate 5 ticks above or 5 ticks below. So my range is -5 to +5. When I pass in -2 I get zero in my code. Is this possible to do? It seems like I have the syntax right.

    #2
    Hello cashinvestor,

    Thanks for your post.

    The syntax appears correct and when tested here I can get any value from -5 to +5, including 0.

    I would suggest debugging with a print statement to print to the output window the value of ExitTicks.

    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by cmtjoancolmenero, Yesterday, 03:58 PM
    1 response
    17 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by benmarkal, Yesterday, 12:52 PM
    3 responses
    23 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by helpwanted, Today, 03:06 AM
    1 response
    20 views
    0 likes
    Last Post sarafuenonly123  
    Started by Brevo, Today, 01:45 AM
    0 responses
    11 views
    0 likes
    Last Post Brevo
    by Brevo
     
    Started by pvincent, 06-23-2022, 12:53 PM
    14 responses
    244 views
    0 likes
    Last Post Nyman
    by Nyman
     
    Working...
    X