instruction
stringlengths
15
26.1k
I'm trying to implement a Backtest for my quant strategy but the calculated theoretical returns are not matching the returns from my implementation. Here's the example: On a given day I have 1 million dollars available to trade and my model tells me to start a short selling operation. Also, on this day, the Mean and...
Probability the stock price (following geometric Brownian motion) hits the upper boundary U before there is a retracement from the max by amount R?
I would like to estimate a given country's default probability with a logit regression from macro variables but there was no default in it's history. I was able to calculate the probabilities of downgrade (credit migration risk) though but I don't know how to calculate the default probabilities from the credit downgrad...
I assume that you want to minimize some error function of your replication. For simplicity, I will focus on the squared error integral below. Without loss of generality, let us assume that for some target strike level $K$ (from set 1), there exist $2n$ symmetrically (around $K$) spaced strikes in set 2, with spacing...
Consider the continuous dynamical system $$\alpha\ddot{S}+\dot{S}=\mathcal{F}(S,t),$$ such that $\alpha\in\mathbb{R}$ and $\mathcal{F}$ is real and analytic. We assume that if a solution for $S$ exists, then $S$ is deterministic. However, for a sufficiently high maximal Lyapunov exponent $\lambda$, when $$\frac{...
I am looking to understand the PDE of Power Options in *Paull Willmot on Quantitative Finance (2nd Ed)*, Ch. 8.9 - Formulae for Power Options (p. 149). Suppose the payoff depends on the asset price at expiry raised to some power i.e.: $\text{Payoff}(S^\alpha)$. If we write $ Z = S^\alpha $ the standard Black-Schol...
Newbie here, it happens that I have **8 months of OHLC price data set at 1 hour timeframe** from a particular cryptocurrency (ticket) called `ALICE`, here's a little sample of those: [![dataframe sample][1]][1] The first column above represent the timestamp of the open price, the next 4 columns represent the **OH...
Should I always round the data before even trying defining and backtesting my trading strategy?
I am trying to understand Open-High-Low-Close (OHLC) data. Several sources agree in the following type of definition ([Source][1]): > An OHLC chart is a type of bar chart that shows open, high, low, and > closing prices for each period. OHLC charts are useful since they show > the four major data points over a per...
If I was to take the current market yield to maturity and tenor for all bonds for a particular issuer how can I convert this curve into a zero-coupon curve? For example if we were to get the yield and years to maturity of all outstanding Australian Government AUD bonds, this would give us the Australian Government y...
How do you construct a zero coupon curve from the current market yield curve?
I had great difficulty finding the answer to this online after a great deal of looking so I hope this will be useful to others. Note the difficulty here is dealing with non-annual coupon payments and real-world dates that do not match round years. What we are essentially doing when creating a zero-coupon curve is...
I'm trying to build a system that recommends stock trades. My goal is calculate optimal values for the following: > 1. Entry Parameter: expressed as a percentage change downwards from the opening price. Our entry price = (opening price) * (1 - this > parameter). The first time the stock price reaches this price o...
If we want to create a zero-coupon curve we can take the market yield curve and bootstrap zero-coupon curve. There are a few complexities which make this difficult like non-annual coupons and tenors not falling on exact years but I think I figured a way around it. I had great difficulty finding the answer to this on...
Vega-Vanna-Volga models seem to be popular in the FX derivatives market and are often calibrated via 25 delta risk reversal, Vega weighted butterfly, and ATM straddle quotes. I am wondering if they are also used to price equity and commodity derivatives. Is there something that makes the model particularly suited to FX...
Are Vega-Vanna-Volga methods/models also used in equity derivatives? Or only in FX? Why?
I assume that you want to minimize some error function of your replication. For simplicity, I will focus on the squared error integral below. Without loss of generality, let us assume that for some target strike level $K$ (from set 1), there exist $2n$ symmetrically (around $K$) spaced strikes in set 2, with spacing...
Is there a more efficient way of hedging exchange rate risk from ADRs instead of constantly trading FX Forwards? How does the industry usually hedge that risk? Moreover, is it reasonable to suppose that the value of every ADR of European stocks is equally sensitive to changes in the EURUSD rate? I'd appreciate su...
I working a lot with Epstein-Zin utility (standard in asset pricing models). But I am having some issues wrapping my head around some intuition for how this utility function works. Let's think about a standard problem of maximization of utility of a consumer who lives two periods. The agent is endowed with wealth o...
In Peter Carr, Dilip Madan, Towards a Theory of Volatility Trading, 1998, (also derived [here](https://quant.stackexchange.com/questions/27626/carr-madan-formula/27628#27628) by Gordon), both calls and puts are used to replicate any twice differentiable payoff. I suppose one would choose the atm fwd to be the kappa and...
A recent preprint appeared on arXiv. It questions the appropriateness of the Black–Scholes formula for the price of a European call option in the context of **already assuming the Black–Scholes model** for the spot price of the underlying. [*Black-Scholes Option Pricing Revisited?*][1] An extract from the abstrac...
I'm trying to build a system that recommends stock trades. My goal is calculate optimal values for the following: > 1. Entry Parameter: expressed as a percentage change downwards from the opening price. Our entry price = (opening price) * (1 - this > parameter). The first time the stock price reaches this price o...
I assume that you want to minimize some error function of your replication. For simplicity, I will focus on the squared error integral below. Without loss of generality, let us assume that for some target strike level $K$ (from set 1), there exist $2n$ symmetrically (around $K$) spaced strikes in set 2, with spacing...
Is it true that approved market makers are simply taking the other side of the orders from retail or maybe institutions whatever the price is without actually being on the order book, and they also won’t be on the footprint chart even after the execution? And I think there’re differences between market makers that’s...
Is it true that approved market makers are simply taking the other side of the orders from retail or maybe institutions whatever the price is without actually being on the order book, and they also won’t be on the footprint chart even after the execution? And I think there’re differences between market makers that’s...
Is it true that approved market makers are simply taking the other side of the orders from retail or maybe institutions whatever the price is without actually being on the order book, and they also won’t be on the footprint chart even after the execution? I think there’re differences between market makers that’s off...
It's a common critique that the original Black-Scholes derivation is somewhat imperfect with respect to the self-financing property, as fesman mentions. Self-financing trading strategies are a key concept in maths finance. After all, we can all replicate any payoff using a non-self-financing strategy by simply injec...
Let $n \geq 2$, and consider a tenor discretization: $0 = T_{0} < T_{1} < ... < T_{n}$ and associated forward rates evaluated at time $t$, as $L_{i}(t):=L(T_{i},T_{i+1};t)$ for any $i = 0,...,n-1$. Furthermore we assume lognormal dynamics under the measure $\mathbb P$, $$ dL_{i}(t)=L_{i}(t)(\mu_{i}^{\mathbb P}(...
I am reading **Trading Volatility** by Collin Bennett and he says that you should compute the Greeks using realized volatility rather than implied volatility? Is this actually true? As far as I know the greeks are usually computed using implied volatility
Should you compute the greeks on realized or implied volatility?
Being recognised market maker allow to have some advantages: on some trading venues they can see the flows of incoming orders with more transparency, on others they pay less fees. Market makers do not "blinding" buy and sell, they implement strategies that are based on two principles - understand the flows: are the...
What are practical examples of adverse selection market makers have to deal with?? I’ve read books but couldn’t really understand the concepts…
I am trying to create a global country index for insurance. So this would be insurance by country. Anybody who is an expert in econometrics can give me some guidance on how to do this? How would I go around creating a methodology, how do I test the variables to include or not etc. Thanks.
If I am trying to price a strategy, say for example a call spread where we are long a call, strike L and short a call strike M, would the pricing formula simply be the Black-Sholes price for the Call at Strike L subtract the Black Scholes price for a call at Strike M? Is it really that simple or am I missing somethi...
In 10.2 in Advances in Financial Machine Learning it says > Suppose that one strategy produced a sequence of bet sizes [m1,1, m1,2, m1,3] = [.5, 1, 0], as the market price followed a sequence [p1, p2, p3] = [1, .5, 1.25], where pt is the price at time t. The other strategy produced a sequence [m2,1 , m2,2 , m2,3 ] =...
At chapter 10.2 in *Advances in Financial Machine Learning* it says: > Suppose that one strategy produced a sequence of bet sizes $[m_{1,1}, m_{1,2}, m_{1,3}] = [.5, 1, 0]$, as the market price followed a sequence $[p_1, p_2, p_3] = [1, .5, 1.25]$, where $p_t$ is the price at time $t$. The other strategy produced a ...
You should have a look at **Mean Field Games** (MFG). Mean Field Game theory studies optimal control problems with infinitely many interacting agents. The solution of the problem is an equilibrium configuration in which no agent has interest to deviate (a Nash equilibrium). The terminology and many substantial ide...
Since the beginning of this year, LIBOR rates have ceased in some markets like GBP, CHF, and JPY and rates pricing has moved into the RFR space, using compounded overnight rates as the underlying for cap-/floor(lets). My questions now are concerned with the **building of a vol surface based on broker quotes of normal p...
Consider a very small maturity $T$ of a call option with strike $K$. Assume log-moneyness is given by $log(S_0/K) =0.8$, where $S_0$ is the current stock price associated to the call. If I would compute local volatility it looks not well defined. Why is this the case? $log(S_0/K) =0.8$ would mean that $S_0/K = 6....
Consider a very small maturity $T$ of a call option with strike $K$. Assume log-moneyness is given by $log(S_0/K) =0.8$, where $S_0$ is the current stock price associated to the call. If I would compute local volatility it looks not well defined. Why is this the case? $log(S_0/K) =0.8$ would mean that $S_0/K = 6....
Consider a very small maturity $T$ of a call option with strike $K$. Assume log-moneyness is given by $log(S_0/K) =0.8$, where $S_0$ is the current stock price associated to the call. If I would compute local volatility it looks not well defined. Why is this the case? $log(S_0/K) =0.8$ would mean that $S_0/K = 2....
We are going to generate synthetic option prices using a **Heston** model, i.e., $$ \begin{gather*} dS_t = \sqrt{v_t} S_t dZ_t,\\ dv_t = \lambda (\mu - v_t) d_t + \eta \sqrt{v_t} dW_t, \end{gather*} $$ where $Z,W$ are standard Brownian motions with $\langle Z,\, W\rangle_t = \rho t$, $S_0 = 1$, $v_0$ as an addit...
I have the following risk function: $\mathbf{Risk}(x):=\mathbb{E}[R(x)]+\delta\mathbb{E}[|R(x)-\mathbb{E}[R(x)]|]$ where $R(x)$ is the portfolio return and $\delta$ is any positive scalar. My textbook assumes this function is convex without proving it. Any ideas how it could be shown it is convex?
How can I show convexity of this risk function?
There is no "correct" way to determine a company's fully diluted shares. There is however an accounting convention that public companies use for financial reporting. In your case, the latter 4Q20 figure, 17.528.214.000, is what the company reports in [its FY2020 10-K][1]. In that 10-K, you'll find the figure rep...
So I am conducting a research on applying Data Envelopment Analysis (DEA) for comparing efficiencies of different companies working in different countries and thereby publishing their financial statements in different currencies. However, before I plug in the values such as revenues and expenses taken from respective ...
How to compare financial statements of two companies working in two different currencies?
This is just a question about terminology for a document I'm writing. - (Simple) return: $X_{t+1}/X_t - 1$ - Log return: $\log\left(X_{t+1}/X_t\right)$ - ???: $X_{t+1}/X_t$ I was thinking "growth factor" maybe? But it has to have a better name.
What do you call a growth factor?
I am sourcing the implied volatility for pricing the option. I am getting the volatility against delta but not the strike amount for those. How do I convert the delta into the strike to find the right volatility from the curve?
We are sourcing the discount factors for various currencies. What is the best interpolation method for dates between and out of the dates provided in the factors? Shall I go for flat forward or cubic spline? Please suggest if any other is better.
I am studying SEC filings and downloaded the Financial Statement and Notes Data Sets from https://www.sec.gov/dera/data/financial-statement-and-notes-data-set.html. From readme.htm of the zip files downloaded, it says 'The following data sets provide information extracted from EX-101 exhibits submitted to the Commis...
What is 'EX-101 exhibits'?
Following the notation of [this post](https://quant.stackexchange.com/questions/42610/fama-macbeth-cross-sectional-regression/42616#42616), the standard errors of the second stage coefficients is computed as $$\sigma^{2}(\hat{\lambda})=\frac{1}{T^{2}} \sum_{t=1}^{T}\left(\hat{\lambda}_{t}-\hat{\lambda}\right)^{2}.$$ ...
What kind of interpolation is this?
I want to understand how the value at risk and the simulating the var with simple Monte Carlo method.But I want just a confirmation and are welcome any comments, since I don't have the full picture of this calculations. Let's say that I have an annual asset with one period of margin risk : ``` library(quantmo...
Can someone explain me the impact of the dividends on an autocall structure please ? Is it going to increase the price because of the Short PDI in the structure ?
Do they directly put limit orders on the order book? Or do they automatically fill limit/market orders from customers and have offsetting position with their market maker(LP) to offset their net position?
How do brokerage firms provide liquidity?
Libor is dead and used to be uncollateralised. Libor-OIS was a useful indicator to measure the spread between risk free (central bank e.g. Fed funds) rate and the interbank lending rate. For example in 2008 the spread shot up reflecting fear in the money markets sector. Now SOFR has replaced LIBOR and SOFR is collat...
What can be used to replace the Libor - OIS indicator in assessing fear in money markets?
**From your statement,** > now if I am so far right, I want to simulate the value at risk **for one day ahead** so I am doing: **it looks like you want to forecast Value-at-Risk** and not just estimate it from the simulation of a Students t-distribution. If you want to forecast your parametric Monte Carlo VaR, yo...
I want to understand how the value at risk and the simulating the VaR with simple Monte Carlo method. But I want just a confirmation and are welcome any comments, since I don't have the full picture of this calculations. Let's say that I have an annual asset with one period of margin risk: ``` library(quantmo...
### Answer to question 1: As mentioned in the linked paper, you estimate the Expected shortfall (ES) or the Value-at-risk (VaR) on the standardized residuals $z_t$, which could be calculated on the basis of a distributional assumption eg. a Gaussian distribution or Student's t-distribution. Remember that the return...
**From your statement,** > now if I am so far right, I want to simulate the value at risk **for one day ahead** so I am doing: **it looks like you want to forecast Value-at-Risk** and not just estimate it from the simulation of a Students t-distribution. If you want to forecast your parametric Monte Carlo VaR, yo...
I thought since brokers on non-OTC market have obligation to get its customers best execution price, it’s meaningless for dealers(market maker) to pay brokers for the order flow for dealers to make “spread profit” from. Because even if a dealer pays brokers for the order flow, if he isn’t the one quoting the best price...
Does payment for order flow happen on non-OTC stock markets?
I have a question while reading THE NELSON–SIEGEL MODEL OF THE TERM STRUCTURE OF OPTION IMPLIED VOLATILITY AND VOLATILITY COMPONENTS by Guo, Han, and Zhao. [![enter image description here][1]][1] [![enter image description here][2]][2] I don't understand why the above equations hold. It's easy to show that ...
I have seen that the Black-Scholes equation $$\frac{\partial V}{\partial t}+\frac{1}{2}\sigma^2S^2\frac{\partial^2 V}{\partial S^2}+ rS\frac{\partial V}{\partial S}-rV=0$$ can also be written in the following form: $$\frac{\partial V}{\partial t}+\frac{\partial}{\partial S} \left( \frac{1}{2}\sigma^2S^2\frac{...
I have a question while reading THE NELSON–SIEGEL MODEL OF THE TERM STRUCTURE OF OPTION IMPLIED VOLATILITY AND VOLATILITY COMPONENTS by Guo, Han, and Zhao. [![enter image description here][1]][1] [![enter image description here][2]][2] I don't understand why the above equations hold. It's easy to show that ...
Say that some corporation has a long position in a fixed rate bond. To turn this into a float-rate asset, they take a fixed paying position in a fixed/float swap. If we are given the par swap curve, we can bootstrap the par swap rates to discount the swap cash flows at the spot rates. My question: Are we allowed to ...
Can I use spot rates bootstrapped from a swap curve to price a bond?
May I please ask the community's support with the following problem? I have 2 time series, with approximately 1000 observations each (same number of observations for both). They represent the daily closing prices for 2 stocks: asset A and asset B. Assuming we are currently at time t, I'm interested in computing (for...
How to compute the combined probability of loss for 2 time series (consisting of historical stock prices)?
I'm currently trying to implement the roll measure adapted by Easley et al. (2020, p. 22). https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3345183 The adapted roll measure is given by the eq below. [![enter image description here][1]][1] However, I do not understand how to implement it. Firstly looking...
I am working on a paper where I have to check how changes in ESG scores relate to stock returns. My sample firms are mostly from European markets(eg. STOXX 600 index) and I need to adjust Fama French factors in my model . Could anyone please help me out where can I get those factor loadings for European markets? Tha...
Basic question: I am a bit curious what are the differences between Fed Fund Rate, OIS and SOFR? All three, as I understand are based on overnight collateralized transactions? (Please correct if I am wrong) And how is 10y SOFR rate calculated as SOFR is based on overnight rate only? Is it simple compounding?
Difference between OIS and SOFR?
The general - and short - answer would be **no**: Except for some hypothetical cases, unless you have a convincing model for the residual spread-over-swap, you cannot use swaps to value your bond. ##### Quick comparison Bonds are traded in the bond market. The cash flows are uncollateralized (of course) and carry t...
Kelly criterion for discrete case: f=[pW-(1-p)L]/LW (1) where f is the fraction of wealth to invest, p the probability of winning, (1-p) the probability of losing, W the return if win, -L the return if loss. The continuous case is: f=E[r]/var(r) (2) where E[r] is the expected return, and ...
I have seen that the Black-Scholes equation $$\frac{\partial V}{\partial t}+\frac{1}{2}\sigma^2S^2\frac{\partial^2 V}{\partial S^2}+ rS\frac{\partial V}{\partial S}-rV=0$$ can also be written in the following form: $$\frac{\partial V}{\partial t}+\frac{\partial}{\partial S} \left( \frac{1}{2}\sigma^2S^2\frac{...
The general - and short - answer would be **no**: Except for some hypothetical cases, unless you have a convincing model for the residual spread-over-swap, you cannot use swaps to value your bond. ##### Quick comparison Bonds are traded in the bond market. The cash flows are uncollateralized (of course) and carry t...
I created 3 different efficient frontiers with 3 different risk factors(sharpe ratio, ulcer performance index and serenity ratio) and I wanted to find both MSR and GMV(and their equivalent for the other two risk factors) on each one. But all 6 points are the exact same point. I wanted to know if it has a meaning behind...
**Question:** Is there any resource I can use to find a list of dates which constitute the start and end of the 'financial' quarters (e.g. Q1, ..., Q4) for the years 2006 onwards? I know sometimes they are arbitrary, but just wondering whether there is any resource, because I couldn't find those from a quick intern...
How to find out the dates of the different financial quarters (e.g. Q1, Q2, etc.)?
Could we use the 2-step system generalized method of moment (GMM) for static regression models? As I know, 2-step system GMM is designed for dynamic panel data models but I see many papers use it for static models as well. Some other papers also include the lag of the dependent variable to their static model to make th...
2-step system-GMM for static panel models?
A trading strategy is defined as follows: starting capital $v_0 = 5$ and 1 risky asset holdings $\varphi_t = 3W_t^2-3t$ where $W$ is a Wiener process. The problem is to find the probability of the value of the strategy at the end of period 1 is greater than zero, $P(V_1>0)$ Now, $V_1=v_0+\int_0^13W_s^2-3t\,dW_s=W_1...
I was once an intern for a small bank with a portfolio mainly composed of gov. bonds, FX Forwards and time deposits. We used to report the daily P&L along with a P&L atributtion to each of the portfolio risk factors, i.e. yield curves for each of the currencies and FX rates. The relevant information for explaining t...
It makes sense to calculate P&L due to passage of time, and to try to separate it into carry and rolldown. What would the P&L be if all the rates today were the same as they were yesterday, with just the time to maturity decreasing? How much would the P&L be if the forward rates implied yesterday were exctly realized? ...
It makes sense to calculate P&L due to passage of time, and to try to separate it into carry and rolldown. What would the P&L be if all the rates today were the same as they were yesterday, with just the time to maturity decreasing? How much would the P&L be if the forward rates implied yesterday were exctly realized? ...
It makes sense to calculate P&L due to passage of time, and to try to separate it into carry and rolldown. What would the P&L be if all the rates today were the same as they were yesterday, with just the time to maturity decreasing? How much would the P&L be if the forward rates implied yesterday were exctly realized? ...
It makes sense to calculate P&L due to passage of time, and to try to separate it into carry and rolldown. What would the P&L be if all the rates today were the same as they were yesterday, with just the time to maturity decreasing? How much would the P&L be if the forward rates implied yesterday were exctly realized? ...
It makes sense to calculate P&L due to passage of time, and to try to separate it into carry and rolldown. What would the P&L be if all the rates today were the same as they were yesterday, with just the time to maturity decreasing? How much would the P&L be if the forward rates implied yesterday were exctly realized? ...
I know Yahoo has stock quote data (OHLCV). But it contains errors. tdameritrade API have 1- and 5-minute data. But it only starts at 7AM ET, instead of 4AM ET. It is only limited to 182 trading days, which is rather limited. Is there an alternative free quote data source that contains the 1- or 5-minute data from...
I'm using a well-known SABR model in order to build an implied volatility surface of caps/floors on a very illiquid market which is entirely missing OTM quotes. What happens to SABR implied smile/surface calibrated only on ITM and ATM quotes? I think that it's going to somehow underestimate/overestimate the real volati...
**Question:** Is there any resource I can use to find a list of dates which constitute the start and end of the 'financial' quarters (e.g. Q1, ..., Q4) for the years 2006 onwards? I know sometimes they are arbitrary, but just wondering whether there is any resource, because I couldn't find those from a quick intern...
I came across with the following problem: > For the Ornstein-Uhlenbeck process $(X_t, 0\leq t\leq T)$ with initial > condition $X_0 = x$, find the stopping time $\tau$ that maximizes > $\mathbb{E}[e^{-r\tau}(S - X_\tau)^+]$, for $r\geq 0$ and > $S > 0$. I am aware that, if the process was a geometric Brownian...
A trading strategy is defined as follows: starting capital $v_0 = 5$ and 1 risky asset holdings $\varphi_t = 3W_t^2-3t$ where $W$ is a Wiener process. The problem is to find the probability of the value of the strategy at the end of period 1 is greater than zero, $\mathbb{P}(V_1>0)$ Now, $V_1=v_0+\int_0^13W_s^2-3t\...
In the company I work for, I use several Python scripts that automate many tasks. However, this happens via the task scheduler. I would like to ask you what solutions are you using that make this possible, outside my machine. Do you use a Virtual Machine? Are your scripts dockerized on Kubernetes? (sorry, don't...