NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 05-31-2010, 07:06 AM   #1
williammanda
Member
 
Join Date: Jan 2009
Posts: 96
Thanks: 0
Thanked 0 times in 0 posts
Default Show more than 2 decimal places

Hello
I'm at a very early stage of learning NT script. I was able to find an indicator that I could modify and everything works except for one issue. The price will only show up to two decimals places and I need four. I'm referring to the price label and the scale (only showing 1.7 now, it needs to be 1.700, please see the "2 decimal" attachment). I only had to change the mathematical equation, no variables were added or changed. Also I have attached the modified indicator "Marketsentiment" which was taken from the "Spread" indicator. This is the line that I modified:

Code:
Value.Set((Instrument2Close[0] / (Closes[Instrument1][0] * mul1 + Instrument2Close[0] * mul2)) / (Closes[Instrument1][0] / (Closes[Instrument1][0] * mul1 + Instrument2Close[0] * mul2)));
This was the original line:

Code:
//Value.Set(Closes[Instrument1][0] * mul1 + Instrument2Close[0] * mul2);    // set output using synchronized data series
In years past declaring a variable type "real" would set it up to show decimal places but I don't see any declaration of that type. I using NT 7 beta 16. Any help would be apprecaited.
Thanks
Attached Images
File Type: png 2 decimal places.png (10.4 KB, 21 views)
Attached Files
File Type: cs MarketSentiment.cs (25.4 KB, 6 views)
williammanda is offline  
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Code Snipet: Show to show one Dropdown InstrumentList selectable in chart jatubio General Programming 19 07-31-2012 10:12 AM
NT Strategy places Orders in the past Obi Strategy Development 1 04-08-2009 11:52 AM
TradeStation Reentrancy Error - places orders for wrong symbol Idruna Automated Trading 3 02-12-2009 12:28 PM
Is there a way to see 2 decimal places in SMA? gsmaster Charting 1 05-02-2008 12:25 PM
Finding decimal places sbgtrading General Programming 3 11-25-2007 07:29 PM


All times are GMT -6. The time now is 04:23 AM.