Function price output hops around sometimes due to rounding - Quantitative Finance Stack Exchange most recent 30 from quant.stackexchange.com 2019-09-21T21:23:45Z https://quant.stackexchange.com/feeds/question/44860 https://creativecommons.org/licenses/by-sa/4.0/rdf https://quant.stackexchange.com/q/44860 1 Function price output hops around sometimes due to rounding CaramelFix https://quant.stackexchange.com/users/39462 2019-04-01T04:36:57Z 2019-04-01T08:15:47Z <p>Say we have a function for estimating the fair price of a security. The function gives outputs <strong><em>rounded</em></strong> 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).</p> <p>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. </p> <p>The problem is, due to rounding off, the output has a tendency to hop around at times, such as at any given time <code>t</code>:</p> <pre><code>px(t0) = 100.0 px(t1) = 100.5 px(t2) = 100.0 px(t3) = 100.5 px(t4) = 100.0 px(t5) = 100.5 </code></pre> <p>This causes the system to needlessly amend the limit order too frequently. </p> <p>How does one get around this problem?</p> https://quant.stackexchange.com/questions/44860/-/44862#44862 1 Answer by wildbunny for Function price output hops around sometimes due to rounding wildbunny https://quant.stackexchange.com/users/3457 2019-04-01T08:15:47Z 2019-04-01T08:15:47Z <p>The root cause is surely that your fair price is quite unstable? Rounding can only serve to stabilise your output value, for example rounding to 0 decimal places would result in 100 for all values.</p>