Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Set Range of Bar Type Property

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

    Set Range of Bar Type Property

    I would like to be able to set/reset the range constraint on one of the integer properties in a custom BarType. For example, allowing zero or a negative value. It would be nice to have something similar to SetPropertyOrder() (i.e. SetPropertyRange(min, max)). How can this be accomplished?

    #2
    Hello aslane,

    As the properties are created behind the scenes, this would have to be accomplished with custom logic.

    https://ninjatrader.com/support/help...pertyname2.htm

    You could ensure the value is set to a value within your own custom range as the script starts. For example if i wanted between -5 and 5.

    myValue = Math.Max(-5, Math.Min(5, myValue));

    This would return which ever is smaller, the variable value or 5 (as the upper bound) and will return whichever is larger, the variable or -5 (as the lower bound).
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by localappleseed, Today, 02:41 PM
    0 responses
    2 views
    0 likes
    Last Post localappleseed  
    Started by kschuble, Today, 01:16 PM
    1 response
    9 views
    0 likes
    Last Post omololu
    by omololu
     
    Started by wooofad, Today, 11:34 AM
    0 responses
    15 views
    0 likes
    Last Post wooofad
    by wooofad
     
    Started by tonynt, Today, 10:06 AM
    1 response
    19 views
    0 likes
    Last Post bltdavid  
    Started by Kediil, Yesterday, 09:26 AM
    2 responses
    35 views
    0 likes
    Last Post Kediil
    by Kediil
     
    Working...
    X