This script shows actual and predicted funding levels for the BitMEX XBTUSD perpetual swap.
It gives exact results when using 1 minute candles, or after leaving any timescale chart open for several hours to collect the new data points. In all other situations it lacks fine precision.