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!
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
NinjaTrader
Set Range of Bar Type Property
Collapse
X
-
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?Tags: None
-
Hello aslane,
As the properties are created behind the scenes, this would have to be accomplished with custom logic.
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
- Likes 1
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Rapine Heihei, Today, 08:25 PM
|
0 responses
3 views
0 likes
|
Last Post Today, 08:25 PM | ||
Started by Rapine Heihei, Today, 08:19 PM
|
0 responses
2 views
0 likes
|
Last Post Today, 08:19 PM | ||
Started by f.saeidi, Today, 08:01 PM
|
1 response
4 views
0 likes
|
Last Post Today, 08:17 PM | ||
Change colour of Stop market and limit orders to red and green via indicator script
by Rapine Heihei
Started by Rapine Heihei, Today, 07:51 PM
|
0 responses
5 views
0 likes
|
Last Post Today, 07:51 PM | ||
Started by frslvr, 04-11-2024, 07:26 AM
|
5 responses
96 views
1 like
|
Last Post
by caryc123
Today, 07:47 PM
|
Comment