# Function price output hops around sometimes due to rounding

Say we have a function for estimating the fair price of a security. The function gives outputs rounded to the nearest 0.5 (that is, the raw output is not a rounded float, but can have a decimal part in between 0 and 0.99).

Now, a trading system takes this input and amends the price of a limit order if the price calculated by this function of ours does not match the price of our order in the orderbook.

The problem is, due to rounding off, the output has a tendency to hop around at times, such as at any given time t:

px(t0) = 100.0
px(t1) = 100.5
px(t2) = 100.0
px(t3) = 100.5
px(t4) = 100.0
px(t5) = 100.5


This causes the system to needlessly amend the limit order too frequently.

How does one get around this problem?