[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Surely there is a better way



PureBytes Links

Trading Reference Links

,


Is there a better way of doing this and are the two
caculations the same?  I seem to recall I had an issue with
the second method.  I really hate to expose myself.

{
IsItInProximity()  return true/false if  Price1 is
close enough to Price2 as defined by the input Tolerance value, using
ATR to relativeize the distance.  This example is not tested.
}

input: Price1(numericseries), Price2(numericseries), tolerance(numeric);
var:Ftol(0);
Ftol = ATR*Tolerance;
IsItInProximity =  Price1 - Ftol < Price2 and Price1 +  Ftol > Price2 ;
IsItInProximity  = absvalue(price1 - price2) < Ftol;
{eof}



Regards,
Ernie
ebonugli@xxxxxxxx