math.sign

Sign: 1, 0 or -1.

math.sign(x: int/float) -> int/float

Parameters

Example

dir = math.sign(close - open)