![]() |
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
|
|||||||
| Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Apr 2008
Posts: 99
Thanks: 0
Thanked 0 times in 0 posts
|
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.
|
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Are you using the wizard or programming directly?
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Apr 2008
Posts: 99
Thanks: 0
Thanked 0 times in 0 posts
|
|
|
|
|
|
|
#4 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
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.html
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Member
Join Date: Apr 2008
Posts: 99
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks for the help.
|
|
|
|
|
|
#6 |
|
Member
Join Date: Apr 2008
Posts: 99
Thanks: 0
Thanked 0 times in 0 posts
|
I'm having trouble doing this. Is the Round2Tick Method the only way?
|
|
|
|
|
|
#7 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
You 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.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#8 | |
|
Member
Join Date: Apr 2008
Posts: 99
Thanks: 0
Thanked 0 times in 0 posts
|
Quote:
double price; Instrument.MasterInstrument.Round2TickSize(); } Is this the correct way? I put this ^^^under protected override void OnBarUpdate() { |
|
|
|
|
|
|
#9 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
No, something like:
double myDouble = Instrument.MasterInstrument.Round2TickSize(yourInd icatorValue);
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#10 |
|
Senior Member
Join Date: May 2008
Location: Hartford, CT. USA
Posts: 618
Thanks: 12
Thanked 24 times in 18 posts
|
More info here...
http://msdn.microsoft.com/en-us/libr...nd(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 integer... period = (int) Math.Round(Value5[0]); Good Luck, RJay
Last edited by RJay; 07-09-2008 at 10:25 AM.
|
|
|
|
|
|
#11 | |
|
Member
Join Date: Apr 2008
Posts: 99
Thanks: 0
Thanked 0 times in 0 posts
|
Quote:
|
|
|
|
|
|
|
#12 |
|
Member
Join Date: Apr 2008
Posts: 99
Thanks: 0
Thanked 0 times in 0 posts
|
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
|
|
|
|
|
|
#13 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
On KamaCoder there is a "Contact Us" menu - http://www.kamacoder.com/ContactUs.aspx
I will send a note to Ben.
Ray
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to not display decimals | LG | General Programming | 4 | 04-18-2008 02:04 PM |
| FX Entry Decimals | trader2be | Connecting | 2 | 12-13-2007 09:24 PM |
| Variable rounded | Richard Von | Indicator Development | 3 | 08-03-2007 06:55 AM |
| fractions/decimals | Gar | Miscellaneous Support | 3 | 05-24-2005 03:07 AM |