Can anybody tell my, how i can get significant digits for instrument? I am need it for writing to file.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Get significant digits for instrument
Collapse
X
-
Hello Dzammer,
I've done a quick google search for significant digits string c# and found the following links:
http://stackoverflow.com/questions/3...ficant-figures
https://msdn.microsoft.com/en-us/lib...v=vs.110).aspx
https://msdn.microsoft.com/en-us/lib...v=vs.110).aspxChelsea B.NinjaTrader Customer Service
-
Originally posted by NinjaTrader_ChelseaB View PostHello Dzammer,
I've done a quick google search for significant digits string c# and found the following links:
http://stackoverflow.com/questions/3...ficant-figures
https://msdn.microsoft.com/en-us/lib...v=vs.110).aspx
https://msdn.microsoft.com/en-us/lib...v=vs.110).aspx
Comment
-
Hello,
No, NinjaTrader does not have a function to to set the number of digits in a string as this is already part of C#.
(NinjaScript is written in C#. Any existing C# functions are not going to be re-created)
Are you finding that using the correct Number format string is not working for you?
What is the output you are getting?
What is the output you are wanting?Chelsea B.NinjaTrader Customer Service
Comment
-
Originally posted by NinjaTrader_ChelseaB View PostHello,
No, NinjaTrader does not have a function to to set the number of digits in a string as this is already part of C#.
(NinjaScript is written in C#. Any existing C# functions are not going to be re-created)
Are you finding that using the correct Number format string is not working for you?
What is the output you are getting?
What is the output you are wanting?
PHP Code:private int GetInstrumentDigits()
{
string digits_str = Instrument.MasterInstrument.TickSize.ToString();
return digits_str.Length - digits_str.IndexOf(Convert.ToChar(CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator)) - 1;
}
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Change colour of Stop market and limit orders to red and green via indicator script
by Rapine Heihei
Started by Rapine Heihei, 04-23-2024, 07:51 PM
|
2 responses
30 views
0 likes
|
Last Post
by Max238
Today, 02:25 AM
|
||
Started by Shansen, 08-30-2019, 10:18 PM
|
24 responses
943 views
0 likes
|
Last Post
by spwizard
Today, 01:29 AM
|
||
Started by Max238, Today, 01:28 AM
|
0 responses
9 views
0 likes
|
Last Post
by Max238
Today, 01:28 AM
|
||
Started by rocketman7, Today, 01:00 AM
|
0 responses
7 views
0 likes
|
Last Post
by rocketman7
Today, 01:00 AM
|
||
Started by wzgy0920, 04-20-2024, 06:09 PM
|
2 responses
28 views
0 likes
|
Last Post
by wzgy0920
Yesterday, 10:43 PM
|
Comment