NinjaTrader Support Forum  

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

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 11-23-2007, 06:11 AM   #1
zoltran
Senior Member
 
Join Date: Nov 2005
Location: , Ontario, Canada
Posts: 400
Thanks: 0
Thanked 0 times in 0 posts
Default Testing for 'equal'

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
zoltran is offline  
Reply With Quote
Old 11-23-2007, 07:01 AM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

See if this helps -

http://www.ninjatrader-support.com/v...ead.php?t=3929
NinjaTrader_Ray is offline  
Reply With Quote
Reply

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
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


All times are GMT -6. The time now is 03:20 AM.