# Fitting k from Avellaneda but the curve is not exponential

I am trying to fit kappa for a ticker. I am using 5 days of data to illustrate how this can be done, which isn't that much data but I think is sufficient to show my problem. This data however appears to have a non exponential function for the (A, k) part.

I am following the method described in this post: How does one calibrate lambda in a Avellaneda-Stoikov market making problem?

Once I have my data, I plotted the mean lambda for each bucket of spread. But I found that the curve seems to not be exponential. Here I show the curve from empirical data vs a few choices of kappa:

The y-axis is in log scale and the empirical curve is not linear in particular not linear at the area less than 0.02.

I also fitted with volume-clock (advance the clock by x when x shares are traded)

I am not sure how to deal with this in practice; are there some adjustments that I need to make to the fitting process? Do I need to make k dynamic in production trading depending on if I anticipate large vs small trades next?

The reason I ask is because I believe either the large trades are hurting my PNL when kappa is too large or I can't get volume from small trade when kappa is too small.

With respect, it looks like a problem with the way you're gathering the data.

What you need to build is a data set recording the fill rate at each tick from the bid/ask, then you can find A and k.

The intuition is that the fill rate must be decreasing in distance from the best prices because in order to fill at, say tick 10, you must have already filled tick 9.

I don't think you can use candle data to do the calibration, you need high frequency data.

Hope that helps,

Cheers, Paul.

• I am indeed using high frequency data, I am not using candles. My data is the market orders themselves. Commented May 16, 2023 at 15:44
• How do you explain the higher fill rate at tick price 0.070 in your graph than the previous tick? To fill 0.070, price must have passed through the earlier tick? Commented May 24, 2023 at 14:01