Compare Functions
Relative comparison functions
| Name | Parameters | Returns | Description |
| Compare.ApproxEqual | (decimal a, decimal b, decimal tolerance) | bool | Returns true if values are approximately equal within tolerance. |
| Compare.Between | (decimal value, decimal min, decimal max) | bool | Returns true if value is between min and max (inclusive). |
| Compare.Far | (decimal value, decimal target, decimal tolerance) | bool | Returns true if value is farther than tolerance from target. |
| Compare.GreaterBy | (decimal a, decimal b, decimal margin) | bool | Returns true if a is greater than b by at least margin. |
| Compare.LessBy | (decimal a, decimal b, decimal margin) | bool | Returns true if a is less than b by at least margin. |
| Compare.MaxOf | (decimal a, decimal b) | decimal | Returns the greater of two values. |
| Compare.MinOf | (decimal a, decimal b) | decimal | Returns the lesser of two values. |
| Compare.Near | (decimal value, decimal target, decimal tolerance) | bool | Returns true if value is within tolerance of target. |
| Compare.Outside | (decimal value, decimal min, decimal max) | bool | Returns true if value is outside min and max. |
Examples
Compare.Near(Price, VWAP, 0.1)
Compare.Far(Spread, 0, 0.05)
Compare.Between(Score, 70, 90)
Compare.Outside(Risk, 0, 1)
Compare.ApproxEqual(a, b, 0.001)
Compare.GreaterBy(Ask, Bid, 0.01)
Compare.MaxOf(LongPnL, ShortPnL)