Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Use the rounded value instead of the exact value with decimals?
Collapse
X
-
Use the rounded value instead of the exact value with decimals?
I want the strategy to use indicator's rounded value that is displayed in the price marker on the chart. When the moving averages are displayed in Panel 2 and I can see the extra decimal points. I don't want to use those exact values/calculations just the rounded ones.Tags: None
-
Thanks for the clarification. Unfortunately this is not possible to do in the wizard. By directly programming it is using the Instrument.Round2TickSize() method.
More information on this here - http://www.ninjatrader-support.com/H...2TickSize.htmlRayNinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_Ray View PostYou could code yourself what we have wrapped in the Round2TickSize method but this wil be a lot harder than just using the method already provided.
double price; Instrument.MasterInstrument.Round2TickSize();
}
Is this the correct way? I put this ^^^under
protected override void OnBarUpdate()
{
Comment
-
More info here...
This example of the decimal.Round( decimal, Integer )
method generates the following output.
Argument``` Digits ```Result
-------- ```------ ```------
1.45 ````````1``````` 1.4
1.55 ````````1 ```````1.6
123.456789 ``4 `````123.4568
123.456789 ``6 `````123.456789
123.456789 ``8 `````123.456789
-123.456 ````0 `````-123
-123.0000000 3 `````-123.000
decimal == Argument
Integer == Digits
Result == the final output.
I also used this to convert a dataseries double value to an integer...
period = (int) Math.Round(Value5[0]);
Good Luck,
RJayLast edited by RJay; 07-09-2008, 10:25 AM.
Comment
-
Originally posted by rt6176 View PostMore info here...
http://msdn.microsoft.com/en-us/library/system.decimal.round(VS.71).aspx
This example of the decimal.Round( decimal, Integer )
method generates the following output.
Argument``` Digits ```Result
-------- ```------ ```------
1.45 ````````1``````` 1.4
1.55 ````````1 ```````1.6
123.456789 ``4 `````123.4568
123.456789 ``6 `````123.456789
123.456789 ``8 `````123.456789
-123.456 ````0 `````-123
-123.0000000 3 `````-123.000
decimal == Argument
Integer == Digits
Result == the final output.
I also used this to convert a dataseries double value to an interger...
period = (int) Math.Round(Value5[0]);
Good Luck,
RJay
Comment
-
I've given up on doing this myself but I'm trying to get in contact with NinjaScript consultants to have this done instead. 2 of them haven't replied to emails, one of them being Ben from AffordableIndicators. The other one Kama has no links to get in contact which is weird. The one who actually replied is too expensive. Are there any other consultants that help with this or another way to get in contact with Ben from AffordableIndicators?
Please help
Comment
-
On KamaCoder there is a "Contact Us" menu - http://www.kamacoder.com/ContactUs.aspx
I will send a note to Ben.RayNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by aussugardefender, Today, 01:07 AM
|
0 responses
1 view
0 likes
|
Last Post Today, 01:07 AM | ||
Started by pvincent, 06-23-2022, 12:53 PM
|
14 responses
238 views
0 likes
|
Last Post
by Nyman
Today, 12:47 AM
|
||
Started by TraderG23, 12-08-2023, 07:56 AM
|
9 responses
383 views
1 like
|
Last Post
by Gavini
Today, 12:29 AM
|
||
Started by oviejo, Today, 12:28 AM
|
0 responses
1 view
0 likes
|
Last Post
by oviejo
Today, 12:28 AM
|
||
Started by pechtri, 06-22-2023, 02:31 AM
|
10 responses
125 views
0 likes
|
Last Post Today, 12:03 AM |
Comment