Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sigma Unit in Avellaneda -Stoikov market making model #4

Open
dingo9 opened this issue Oct 26, 2022 · 0 comments
Open

Sigma Unit in Avellaneda -Stoikov market making model #4

dingo9 opened this issue Oct 26, 2022 · 0 comments

Comments

@dingo9
Copy link

dingo9 commented Oct 26, 2022

In Reserve Price Equation and Reserve Spread Equation, sigma ** 2 is used to measure market volatility risk, like

            r[n] = s[n] - q[n] * gamma * sigma ** 2 * (T - dt * n)
            r_spread = 2 / gamma * math.log(1 + gamma / k) + gamma * (sigma ** 2) * (T - t / float(M))

sigma*2 is given by preset in demo code to generate brownian process, and it can be calculate by std of brownian path.
As I do such experiment, I found interesting thing

import numpy as np
import brownian as bm

delta = 2  # The Wiener process parameter.
T = 10.0  # Total time.
N = 500  # Number of steps.
dt = T / N  # Time step size
m = 100  # Number of realizations to generate.
x = np.empty((m, N + 1))  # Create an empty array to store the realizations.
x[:, 0] = 1000  # Initial values of x.
bm.brownian(x[:, 0], N, dt, delta, out=x[:, 1:])

# %% check std and vol risk price
std = np.diff(x, axis=1).std(axis=1) / np.sqrt(dt)
# all sequence std close to delta
np.testing.assert_allclose(delta, std, rtol=0.1)
# so vol risk is gamma * sigma ** 2 = 4 * gamma, risk value / S0 is 4 * gamma / 1000 = 0.004 gamma

# %% round x to min float price 0.1, std value and risk value is not change
x_round = np.round(x, 1)
std_round = np.diff(x_round, axis=1).std(axis=1) / np.sqrt(dt)
np.testing.assert_allclose(delta, std_round, rtol=0.1)

# %% If price Unit changed, like previous unit is dollar/gram, to dollar/10gram, aka new price is 10 * x

x_10 = 10 * x_round
std_10 = np.diff(x_10, axis=1).std(axis=1) / np.sqrt(dt)
# std also times 10 times
np.testing.assert_allclose(delta * 10, std_10, rtol=0.1)
# so vol risk is gamma * sigma ** 2 = 400 * gamma, risk value / S0 is 400 * gamma / 10000 = 0.04 gamma

So, why vol risk changed when we just change price unit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant