![]() |
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Senior Member
Join Date: Nov 2005
Location: , Ontario, Canada
Posts: 400
Thanks: 0
Thanked 0 times in 0 posts
|
Testing 'double' variables such as EMA's or other indicators can be a challenge. For example, even though YM is denominated in whole dollars without a decimal.. an EMA can have 12900.111, 12900.112, 12900.011 etc. This displays as a flat line on the chart but fails the basic '==' equality test.
So .. what's the best way of dealing with this? Round() comes to mind, but this is a pain as you need to use a different rounding/decimal amount for each instrument. Thanks in advance |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Ray
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Testing for null | zoltran | General Programming | 7 | 11-25-2007 05:09 PM |
| Need to set a stop loss equal to indicator value... | dendy | Strategy Development | 2 | 10-16-2007 08:12 AM |
| Testing and Playback | guy | Indicator Development | 2 | 03-18-2006 01:44 AM |
| End-to-End Testing of a System | aspTrader | Automated Trading | 0 | 12-02-2005 02:28 AM |
| Re Back testing | John_Aus | Miscellaneous Support | 6 | 03-15-2005 01:54 AM |