![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Aug 2008
Posts: 233
Thanks: 19
Thanked 5 times in 5 posts
|
I am using the following line of code to round down which works without any problems,
Code:
((int)(Close[0]/100))*100 Any help would be greatly appreciated. suprsnipes |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,420
Thanks: 252
Thanked 981 times in 963 posts
|
Have you tried yet Math.Ceiling for this task?
http://msdn.microsoft.com/en-us/libr...ng(VS.80).aspx
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Aug 2008
Posts: 233
Thanks: 19
Thanked 5 times in 5 posts
|
The following code has it working
Code:
roundnUP = ((int)Math.Ceiling(Close[0]/100))*100; |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Rounding error on Euro | cunparis | General Programming | 5 | 01-04-2010 05:22 AM |
| Rounding to the nearest integer... | 8DTK8 | Strategy Development | 4 | 11-30-2009 03:57 PM |
| Rounding confusion | safetrading | Indicator Development | 3 | 08-28-2009 02:49 PM |
| rounding of values | anniebee | Suggestions And Feedback | 4 | 06-21-2009 12:09 AM |
| Rounding off to an integer? | Burga1 | General Programming | 1 | 01-02-2008 10:20 PM |