PDA

View Full Version : Testing for 'equal'


zoltran
11-23-2007, 06:11 AM
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

NinjaTrader_Ray
11-23-2007, 07:01 AM
See if this helps -

http://www.ninjatrader-support.com/vb/showthread.php?t=3929