instruction
stringlengths
15
26.1k
St Louis Fed published in 2006 a very nice paper: [*What Are the Odds? Option-Based Forecasts of FOMC Target Changes* by William Emmons, Aeimit Lakdawala, and Christopher Neely][1], which discusses futures on fed funds, options on such futures, implied risk-netural probabilities, and how they differ from objective real...
This perhaps is an over simplification of calculating trading returns while including trading costs. I've made some assumptions - the commission for investing in a extract investment is 1% and 2% respectively and does not change over the trading period which in this case is 5 time steps. I've used Python code to perfor...
This perhaps is an over simplification of calculating trading returns while including trading costs. I've made some assumptions - the commission for investing and extracting an investment is 1% and 2% respectively. The commissions do not change over the trading period which in this case is 5 time steps. I've used Pytho...
Here's an implementation (in Matlab, not VBA). https://github.com/crodriguezvega/black-scholes-european-option/blob/master/blsEuropeanOption.m EDIT: a second implementation (again in Matlab) including the third order Greeks: https://kr.mathworks.com/matlabcentral/fileexchange/69544-calcgreeks-calculate-option-...
I have a question related to accessing historical data. My first attempt to grab historical data for a few companies was using Google sheets and the *GOOGLEFINANCE* function. Unfortunately, it seems to be fairly limited. Running this function works very well and I could not be happier: `=GOOGLEFINANCE("AAPL", "pr...
I am interested to build the following matrices in Python $B_{tt'} = e^{−|t − t'|/\tau }$ and $B_{tt'} = b^{|t−t'|}$, with $|b| < 1$. Could someone please demonstrate to me a Pythonic way to build these matrices? Thanks!
Estimating ex-post risk premium is easy. Estimating ex-ante risk premium, on the other hand, is the holy grail of investing and is incredibly difficult. As @noob2 has mentioned, if you assume that risk premium is constant, then using a very long-term historical estimates would suffice. Empirical evidence, however...
Mid price is so noisy so I try to use the weighted price, which is much better. However I want to define a better price called micro-price, I use different level of quote and give the different parameter to the multi-level price, however I can't get a better price than the weighted price. My question is : 1, How can...
Mid price is so noisy so I try to use the weighted price, which is much better. However I want to define a better price called micro-price. I use different level of quote and give the different parameter to the multi-level price, however I can't get a better price than the weighted price. **My questions are:** ...
I'm investing in long term. By different means not related to this question, I've already decided that I want to buy or sell a particular instrument, but I'm not in such a hurry: - I'm still allowing a few days, say 2 to 5, to execute the operation at an optimized price. - If, at the end of the last day, I was ...
I'm experimenting with Parkinson's Number and the Garman-Klass estimator I'm wondering what the appropriate number of days to sample over, is the number over 1-day useful at all, or should one take it over a week or more at a time? Also with the Parkinson Number, Taleb in Dynamic Hedging uses 1.67 ratio to determin...
I need to price a callable Equity Return Swap by Accrual. ERS has property callable T+1 and I don't get it. Does it mean that when a call happen we fix a price that and pay Accrual the next day? Could you please go over it a bit?
I am interested to build the following matrices in Python $B_{tt'} = e^{−|t − t'|/\tau }$ and $B_{tt'} = b^{|t−t'|}$, where $t,t' = 1, 2, \ldots , T$ for some fixed $T$, $|b| < 1$, and $\tau > 0$. Could someone please demonstrate to me a Pythonic way to build these matrices? Thanks!
Below will do the trick without using `np.matrix`. The matrix class isn't used much. See docs [here][1]. They recommend avoiding it and using arrays instead. Below are 2 separate approaches. The first function is convolutional, the second is statistical (normalized on [-1,1] interval). The input `x` should be a...
When we try to build a curve, we somehow need "fixings". Looks like it is when the market data created date less than the evaluation date, we put that market data into fixings. I don't really under what is this and why we need this. Could someone please give me some direction ?
When we try to build curves, why we need fixings?
Shouldn't (according to the Black-Scholes model) the price of a call option with a strike of an arbitrary amount away from the current asset's price, be equal to the price of a put option with the same "distance to exercise", just in the opposite direction? In other words: Shouldn't a call and put with symmetric strike...
Equal prices for call and put options with symmetric strikes around contemporaneous price?
Ordinary stock data not only consists of closing prices, but also **gross volume** traded in the security by end-of-day. It is always reported in absolute terms even though there could have been more buying (bid) activity than sell (ask) activity (executed transactions) by end-of-day. Based on the gross volume or other...
How to tell if Level I volume is net bid or ask side?
I'm calculating the greeks for a hypothetical binary option, and I'm getting a symmetrical parabola for the vega's of both put and call options that are OTM, ATM, and ITM. Both of them dip into negative territory however. The vega for the call becomes negative when the binary option moves more into-the-money, while the...
Can a market practitioner explain how par par asset swaps work? I understand the swap fixed leg has the same details as the bond i.e. the fixed rate is equal to the bond coupon rate. The way I look at it: the notional of the swap is the par value of the bond, otherwise fixed payments wouldn't match and the investor wan...
I want to port some QuantLib-Swig dependent code written in Python to C++ with QuanLib-1.17. However some YieldTermStructure classes (PiecewiseLogCubicDiscount, PiecewiseLinearZero and PiecewiseCubicZero) are not present in QuantLib-1.17. I found some [yield curve examples][1] that seems to cover those classes' func...
I am working on option pricing using GARCH models and, currently, I am coding the pricing of options under the Heston and Nandi (2000) model. This model admits a quasi analytical formula for pricing options. As a benchmark, I originally worked out some code that mimicks the behavior of the functions provided by Peter C...
I am working on option pricing using GARCH models and, currently, I am coding the pricing of options under the Heston and Nandi (2000) model. This model admits a quasi analytical formula for pricing options. As a benchmark, I originally worked out some code that mimicks the behavior of the functions provided by Peter C...
Mid price is so noisy so I try to use the weighted price, which is much better. However I want to define a better price called weighted price **My questions are:** 1. How can I get a good weighted price 2. How to judge the weighted-price. How can I define an indicator to judge whether the weighted price is...
I'm trying to build a model to predict the volatility for a financial asset with ARIMA-GARCH model. I fit my ARIMA model with AIC and I did a Engle’s Test to ensure there is a ARCH effect in the residuals of ARIMA model. However, the problem came after when I finished fitting my GARCH model, I implemented Engle’s Tes...
I'm trying to build a model to predict the volatility for a financial asset with ARIMA-GARCH model. (I use log returns as data) I fit my ARIMA model with AIC and I did Engle’s Test to ensure there is a ARCH effect in the residuals of ARIMA model. However, the problem came after when I finished fitting my GARCH model...
The tick data shortly before the close in yesterday have different statistics and charasterices compared to the tick data shortly after the open in today. Then, how I calculate the indicators using the data in these two periods? For example, my some simple indicators use mean value of data in previous 100 ticks, so I h...
I read that recently, due to the covid-19, the pressure on the dollar market has risen significantly on the demand side. That is why the dollar basis became largly negativ. https://www.bloomberg.com/news/articles/2020-03-17/how-cross-currency-basis-swaps-show-funding-stress-quicktake https://www.bis.org/publ/bisbu...
Dollar basis calculation. Where do I miss the point?
I am trying to understand the compounding in Basis Swap. I had 2 type of basis swap trade as below 1, USD SOFR FF BASIS LCH – compounded FF (USD-Federal Funds-H.15-OIS-COMPOUND) 2, USD LIBOR 3M FF 3M BASIS – weighted FF (USD-Federal Funds-H.15) Could somebody explain here why we are using different Fed Fund inde...
I have been trying hard to find some historical futures and options electricity data for [EEX][1] offerings. I need the data for a model I am writing, however I have not found any free resources so far. It is quite straightforward to web scrape their current tables with data for each type of future/option contract, how...
Historical energy market data for European power Futures and Options?
I am working on option pricing using GARCH models and, currently, I am coding the pricing of options under the Heston and Nandi (2000) model. This model admits a quasi analytical formula for pricing options. As a benchmark, I originally worked out some code that mimicks the behavior of the functions provided by Peter C...
Estimating marginal contributions to VaR in a simulation setting is apparently quite difficult (see [e.g. this blog post][1]) due to issues with sampling variability. My question is whether the following approach for incremental (where a position is removed in entirety) has the same issues. In practice I am seeing a lo...
Looking at the book "Advances in financial machine learning" the author proposes a way to sample high frequency financial data in several fashions which are not only the standard time bars. I was trying to prepare a dataset for doing multivariate analysis using time series of several different futures. In doing that I ...
A quanto option is a derivative with the underlying and strike price denominated in one currency, but the instrument itself is settled in another currency. This has consequences for the calculation of the greeks. The `BS delta` *measures the rate of change of the option price relative to the change of underlying price....
If you have a portfolio of stocks and options it's straight forward enough to generate correlated stock paths and evaluate the positions at the end of the time horizon, but what do you do if your portfolio also consists of other derivatives like swaps, FX forwards etc. I know you can calibrate stochastic processes to s...
As I see it, I’m both, a (MC) simulation or a historical simulation, risk estimators (VaR, iVaR, mVaR) suffer from the instability of the quantile. If we has a sufficiently “dense” set of observations around the $1-\alpha$ strip, we could simply average there and find risk factor and instrument contributions. Yet, in...
I've been looking on some information when it comes to vanilla Interest Rate Swaps, and building delta ladders under a multicurve environment. **https://quant.stackexchange.com/questions/29804/ir-swaps-curve-sensitivity-at-maturity-node/29806#29806**, this answer has been wonderful in explaining the methods for calcula...
Suppose there exist both American-style and European-style put options on the same underlying asset, at the same strike price, and with the same expiry date. Suppose the European put is selling below intrinsic value. Given that American put options are more valuable than European put options, it will be possible to get...
Suppose there exist both American-style and European-style put options on the same underlying asset, at the same strike price, and with the same expiry date. Suppose the European put is selling below intrinsic value. Given that American put options are more valuable than European put options, it will be possible to get...
I was reading something in which the author said: "the longer the maturity, the more and more gaussian the gamma of your option is". What exactly is the author trying to say in non-math terms and what does it mean to become more and more gaussian?
What does it mean for something to become more gaussian?
As I see it, in both, a (MC) simulation or a historical simulation, risk estimators (VaR, iVaR, mVaR) suffer from the instability of the quantile. If we has a sufficiently “dense” set of observations around the $1-\alpha$ strip, we could simply average there and find risk factor and instrument contributions. Yet, in ...
I am trying to understand the compounding in Basis Swap. I had 2 type of basis swap trade as below 1. USD SOFR FF BASIS LCH – compounded FF (USD-Federal Funds-H.15-OIS-COMPOUND) 2. USD LIBOR 3M FF 3M BASIS – weighted FF (USD-Federal Funds-H.15) **Could somebody explain here why we are using different Fed Fund ...
As I see it, in both, a (MC) simulation or a historical simulation, risk estimators (VaR, iVaR, mVaR) suffer from the instability of the quantile. If we had a sufficiently “dense” set of observations around the $(1-\alpha)$ quantile strip, we could compute a weighted average around that quantile and find risk factor an...
A quanto option is a derivative with the underlying and strike price denominated in one currency, but the instrument itself is settled in another currency. This has consequences for the calculation of the greeks. The `BS delta` *measures the rate of change of the option price relative to the change of underlying price....
In CAPM (security market line), the returns are **endogenous**. It is the result of the equilibrium of the entire market according to the mean-variance criterion, and is not determined by the so-called risk (variance, beta, or covariance). The beta value is calculated from the equilibrium return, using beta value to ex...
In fact, **the WACC is misinforming us; it is neither a cost nor a required return** but a weighted average of a cost and a required return. The corporate finance community promotes the WACC as a comprehensive cost of capital to guide investment decisions. This practice is wrong. Suppose that the risk-free rate is 5% (...
This statement is both unclear and somewhat incorrect. To be more understandable the author should have said "as the option maturity becomes longer, the curve of Gamma vs stock price takes on more and more a broad, symmetrical bell shape". So he is using the fancy word Gaussian as a synonym for Bell Shaped, not as a...
This statement is both unclear and somewhat incorrect. To be more understandable the author should have said "as the option maturity becomes longer, the curve of Gamma vs stock price takes on more and more a broad, symmetrical bell shape". So he is using the fancy word Gaussian as a synonym for Bell Shaped, not as a...
Are there any applications of abstract algebra (group theory, rings, fields etc.) in any branch of either economics or finance?
Yes, I've seen some interesting papers that improve one's insight into how things work, even if it is not clearly applicable to practice. Belal Ehsan Baaquie published several books on applications of quantum mechanics and quantum field theory to finance, particularly interest rates. They're definitely fun to read. ...
I've been looking on some information when it comes to vanilla Interest Rate Swaps, and building delta ladders under a multicurve environment. **https://quant.stackexchange.com/questions/29804/ir-swaps-curve-sensitivity-at-maturity-node/29806#29806**, this answer has been wonderful in explaining the methods for calcula...
Yes, I've seen some interesting papers that improve one's insight into how things work, even if it is not clearly applicable to practice. Belal Ehsan Baaquie published several books on applications of **quantum mechanics** and **quantum field theory** to finance, particularly interest rates. They're definitely fun t...
Sry, I'm new here. But I am just astonished by all those sick questions and answers you ask/provide... Are most of you studying mathematics or are your finance programs that good, that you can ask/answer such mathematical questions? Or did you learn those things after many years at work? I'm about to finish my master...
What the ... are all of you studying/working for asking such questions?
Yes, I've seen some interesting papers that improve one's insight into how things work, even if it is not clearly applicable to practice. Belal Ehsan Baaquie published several books on applications of **quantum mechanics** and **quantum field theory** to finance, particularly interest rates. They're definitely fun t...
Whilst this doesn't apply to chaos theory, it does apply in regards to using theories outside the realm of Computer Science and Economics. In research it appears that 'Econophysics' is being more widely studied. You are correct that most research is just a broad statement about how theory X could apply to reality Y fol...
"Could we just run the OLS regression and get the alpha as part of the coefficients that way?" **NO!** For more, see [CAPM is neither a cross sectional model, nor a time series model](https://quant.stackexchange.com/a/53702/34440)
"CAPM is just a regression, which is not true in fact" from [skoestlmeier](https://quant.stackexchange.com/a/47272/34440) is correct. However, we are not able to test CAPM 1. [CAPM is neither a cross sectional model, nor a time series model](https://quant.stackexchange.com/a/53702/34440) 2. Time series return is...
A quanto option is a derivative with the underlying and strike price denominated in one currency, but the instrument itself is settled in another currency. This has consequences for the calculation of the greeks. The `BS delta` measures the rate of change of the option price relative to the change of underlying pri...
How do I calculate or estimate the degrees of freedom in order to perform a Monte Carlo simulation of asset returns with multivariate t distribution using R functions? I am able to calculate the mean vector of asset returns `mu`, as well as the covariance matrix `covmat` of asset returns. I also understand that `Sigma...
It is a pity that **all textbooks now (2020-04-30) are WRONG on CAPM**. Cause there is a Misunderstanding of the market portfolio: The portfolio separation of Tobin (1958) brings the market portfolio front and center. Although investors have different wealth and preferences, investors with mean-variance preferences all...
I need to show that the Hull-White model $$dr=(\theta(t)-ar)dt+\sigma dW^Q$$ corresponds to the Heath-Jarrow.Morton formulation $$df(t,T)=\alpha(t,T)dt+\sigma e^{-a(T-t)}dW^Q.$$ I obtained the drift by with drift condition $$\alpha(t,T)=\sigma(t,T)\int_t^T\sigma(t,s)ds,$$ where $\sigma(t,T)=\sigma e^{-a(T-t)}.$ Then, ...
Overnight(ON) volatility is the first input of a volatility surface, 1 weeks, 2 weeks and so on... Say I have a volatility surface with ON expiry of 1 day, is there anyway to extrapolate volatility for 8 hours expiry?
How to extrapolate shorter tenor from volatility surface?
I have two quasi definitions or interpretations of gamma risk in the context of the BSM model (please correct me if these don't make sense): 1) it is the option's sensitivity to jumps in the underlying 2) it is the option's sensitivity to realized volatility in the underlying What I don't quite understand is...
What is the source of gamma risk?
I am analysing the effects of some Central Bank's policies on asset prices. Among others, daily 5y and 10y Greek government bond yields are part of my dataset. Data are fromm Datastream. [![bond yields][1]][1] I know that Greece was hit by the sovereign debt crisis from 2011, and that this led to haircuts on de...
I'm building out a calibrated USD MultiCurve set, focusing on Fed Funds & 3M LIBOR for the purpose of trading in Fed Funds Futures and Eurodollar Futures (for now ...). I had always assumed that the OIS/Fed Funds rate (perhaps with a turn-of-calendar spread adjustment) was used as the discounting curve itself. In re...
I need to show that the Hull-White model $$dr=(\theta(t)-ar)dt+\sigma dW^Q$$ corresponds to the Heath-Jarrow-Morton formulation $$df(t,T)=\alpha(t,T)dt+\sigma e^{-a(T-t)}dW^Q.$$ I obtained the drift by with drift condition $$\alpha(t,T)=\sigma(t,T)\int_t^T\sigma(t,s)ds,$$ where $\sigma(t,T)=\sigma e^{-a(T-t)}.$ Then, ...
I am writing to ask if the Combinatorial (Purged) Cross-Validation" method of Marcos Lopez de Prado's "Advances in Financial Machine Learning" book is similar to the idea of bootstrap. If not, what is the key difference? It seems like bootstrap is based on permutation (resampling with replacement) and C(P)CV is based o...
Is C(P)CV similar to boostrap?
I am trying to better understand the Heston model and its implementation. It seems like a lot of people use the FFT method for calculating the call prices during the Heston calibration, but the Monte Carlo method is used to calculate the prices with the calibrated parameters. What is the point in this? Why not just use...
Suppose that the short rate follows the process $$dr(t) = a(t, r(t))dt + \sigma(t, r(t))dW(t)$$ If $B(t) = exp(-\int_0^t r(u) d u)$, can one still write the differential $dB(t)$ a-la-Ito? Thanks.
As I have seen in my portfolio theory class, we define the weights of some assets and quantify the risk and return of the whole portfolio. In this setup, the weights do not change in time. What if the weights vary in time, like every second... Is this out of the scope of portfolio theory? What should I study? Thanks
Hey i need to know if the task is done correctly, please help :) Standard deviation of the rate of return on the market portfolio is equal to $\sigma_{MP}=1,5\%=\frac{15}{1000}$. I have portoflio with 3 assets with weights $w=(\frac{3}{10},\frac{2}{10},\frac{5}{10})$ and Beta of this assets is equal $\beta_1=-\frac{5}...
CAPM Model, is this exercise done correctly?
When interested in the **beta of a portfolio**, I see people make a weighted sum of the portfolio components' betas. Intuitively, I would have calculated the beta of the portfolio based on its aggregate return though. Why is my approach wrong?
Lets say I have no clue on correlation between 2 equities in the market (i.e. i don't have an observable market price). What is the best way to go about marking this correlation for lets say the best of option? One alternative is historical data but that's not the same as realised correlation. Should I mark it conserva...
What to do if certain parameters are not market observable?
I have two quasi definitions or interpretations of gamma risk in the context of the BSM model (please correct me if these don't make sense): 1) it is the option's sensitivity to jumps in the underlying 2) it is the option's sensitivity to realized volatility in the underlying What I don't quite understand is...
I'm interested in finding resources related to historical VaR calculation for derivative portfolios where both spot and implied volatility changes are accounted for. The resources I've been able to find so far haven't conditionally estimated the IVS changes based on the spot changes, or they've estimated only a sin...
Resources on VaR modelling for derivative portfolios?
In a Full Regal scenario, you would 1) identify your risk factors (ATM point? Skew? Surface? SABR?) Say you want to simulate all surface points. Then, after you have applied your surface returns you need to first make sure that your new IV surface is free of arbitrage. That is an art in itself, though. Then you do th...
I'm interested in finding resources related to historical VaR calculation for derivative portfolios where both spot and implied volatility changes are accounted for. The resources I've been able to find so far haven't conditionally estimated the IV Surface changes based on the spot changes, or they've estimated onl...
Suppose I have developed two versions ($A$ and $B$) of a factor model for ranking stocks. Both versions of the model use the same scoring system: stocks are percentile ranked within a given universe of stocks from 0-100% based on a weighted sum of standardized factor scores. The difference between model $A$ and mode...
If the expiry value is given by $f(x,T) = e^{-c x}$ for $x \ge a$ and 0 otherwise and c is a +ve constant, prove that in the Fourier domain: $$ (c + j \omega) F(\omega, 0) = e^{-rT} e^{-a(c+j\omega)}e^{-r T \omega^2} $$ **Solution** --- First, the Fourier transform of $e^{-cx}$ is $\frac{e^{-a(c+j \omega)}}...
The total wealth of the USA (2019) is $106 Trillion. [\[1\]][1] The total market capitalization of US companies is $37.6 Trillion. [\[2\]][2] Okay, other countries can invest in US markets more than we invest in theirs. But supposing that weren't the case, is it numerically possible for the total market cap to e...
Can the total market cap of a system increase beyond its total wealth?
Can the total market cap of a country increase beyond its total wealth?
I recently updated to Ubuntu 20.04, as well as to R v4. When updating packages, I ran into an issue with QuantLib. I tried removing/reinstalling, but the reinstall was a different version. RQuantLib is indicating it cannot install, so I am attempting to remove/reinstall QuantLib and Boost. I seem to not be removing e...
Apologies if this has been asked already, but I'm interested in understanding the situations when realized volatility may be higher than implied volatility in practice (if these periods exist). I know in generally up-trending markets ("good times") implied vol tends to be higher than realized vol, in which case a de...
When is realized vol higher than implied vol in practice?
Where can I the ISIN of futures on say SP500 eg ESM20? Is there a way to retrieve ISINs for past futures contracts?
Where can I find the ISIN of futures on say SP500 eg ESM20? Is there a way to retrieve ISINs for past futures contracts?
Silly question, but how would you actually price $$ E_0 \left( \left( \int_0^T dW_t \right)^2 - K \right)_+ $$ where $dW_t$ are standard Brownian motions. Is there a closed form analytical solution?