instruction
stringlengths
35
27.7k
I'm new to applying the Black Litterman model. One point that is troubling me, from a multi asset point of view, is the market portfolio as the starting point for the model. Correct me if I'm wrong but this is based on the entire estimated allocation of the market to a particular asset. So for a stock, this would be it...
Given a set of calibrated SABR parameters, what is the approach to get the implied vol for a given delta ? thanks
XCS (cross currency swap) can be: Float vs float #1 Fixed vs fixed #2 Float vs fixed #3 #2 can be constructed with 2 fixed vs float irs and 1 xccy basis swap #1 #3 can be constructed with 1 irs and #1 An FX swap is equivalent to #2 risk wise (I think?) Is it true that: #1 has fx risk, interest rate risk for each ...
In the Longstaff & Schawartz article they condition on using In-The-Money (ITM) paths only for the regression. The reason for this is to obtain more accurate results and also reduce the computational burden. However, if I blindly implement this approach and the consider an American Put option that is far Out-of-The-Mon...
Building an API that integrates with backtrader and QuantConnect to run some backtests. I'm passing in machine generated data and I just want to make sure I'm not sending them too much stuff. so what data does Backtrader and QuantConnect collect from users?
Say we’re selling a TRS on a local MSCI index denominated in USD and delta hedge it by buying eq futures on that local index denominated in local currency (non USD). Let’s also ignore repo/div/ir risk and only look at fx and funding. One option would be to sell an fx spot (sell usd, buy local currency) replicating the ...
As stated in the title, who first derived the formula $$ \text{Varswap strike} = \int_{\mathbb R} I^2(d_2) n(d_2) \, \mathrm d d_2 $$ where $d_2$ is the Black-Scholes quantity $$ d_2 = \frac{ \log S_t/K}{I\sqrt{T-t}} - \frac{I\sqrt{T-t}}{2} $$ and $n(d_2)$ is the standard normal density function? The earliest reference...
There are two stocks: $S_t$ and $P_t$ $$dS_t = S_t(\mu dt + \sigma dB_t)$$ $$dP_t = P_t((\mu + \varepsilon) dt + \sigma dB_t)$$ Is there any risk-neutral measure? My thoughts are pretty simple: $μ$ is for the physical measure, so there's no risk-neutral measure. Please shed light on this question.
It seems incredibly difficult to not only come up with a list of options for active risk of private assets (Private Equity, Private Credit, Infrastructure, Real Estate, etc.) but also get senior people agree on what the active risk limit should be. The crux of the issue appears to be modelling assets in your portfolio ...
I'm thinking about the relationship between the volatility of a bunch of single stocks and the US VIX - as the companies in question tend to export heavily to the US. To get a grasp over the beta involved, I was thinking about taking 5-day changes in the single stock implied vols (interpolated to a constant maturity li...
I am trying to solve this problem where we're asked to compute the quadratic variation of a process. I assume that it is necessary to apply Ito's formula but not sure how to get the right solution. Furthermore, I'm also not sure about how to apply Ito's formula to a function that includes integrals like this one. I am ...
This is the simplest backtest I've come up with, yet I can't figure out how TradingView has calculated the Sharpe ratio to be 0.577. I've set the risk_free_rate=0. Is it possible to extract the formula that TradingView is using from this simple example, or more data is needed?
My question is related to this thread, but I'm interested in a special case. Suppose that the price of an asset starts at 100 USD, and changes according to a geometric random walk; one step of 1% either up or down at each second. You start with an equity of 100 USD, and you put 100 USD at each trade. The strategy is a ...
Let (B, S) a multi period binomial model that is arbitrage free. I would like to prove that the unique optimal exercise time for an American call option is the maturity time T. My idea is to prove this result by contradiction. I want to find an exercise time t<T, such that there exists an arbitrage opportunity, so that...
I would appreciate any help or guidance please as I do not understand how to find the corresponding portfolio to use as benchmark to find the Excess Return that is used in the Baseline Regression model of Faulkender & Wang (2006). My doubt is with the dependent variable: $$ r_{i,t}-R^{B}_{i,t} = \text{independent varia...
Consider the following asset pricing setting for a perpetual defaultable coupon bond with price $P(V,c)$, where $V$ is the value of the underlying asset and $c$ is a poisson payment that occurs with probability $\lambda$. Both $V$ and $c$ evolve as geometric Brownian motions, potentially correlated with: $$\frac{dV_t}{...
I recently saw someone write, on a generally non-technical platform, that the Black-Merton-Scholes vanilla option price is the first term of an expansion of the price of a vanilla option. I get that in the context of stochastic volatility models by making use of the Hull and White mixing formula. And thus also for the ...
I'm playing around with QuantLib and trying to price an interest rate cap using HW 1F model. import QuantLib as ql sigma = 0.35 a = 0.1 today = ql.Date(18, ql.May, 2023) ql.Settings.instance().setEvaluationDate(today) day_count = ql.ActualActual(ql.ActualActual.ISDA) forward_rate = 0.075 forward_curve = ql.FlatForwa...
I am trying to understand how transfer pricing is accounted for for margined trades. The treasury department within a bank will provide trading desks funding at some base rate plus a transfer pricing spread: the cost of funding. For an uncollateralised derivative, future payments should be discounted at this funding co...
I'm looking for a library like BackTrader or platform that is written in C++ for backtesting. Is C++ a good choice to write a backtester and are any available?
I encountered this phrase in the textbook by Hans Schumacher For the purposes of this textbook, a mathematical model for a financial market consists of a specification of the joint evolution of prices of a number of given assets. Further information that may be important in practice, such as trading restrictions, are ...
I am building a VaR model (in Excel using the variance-covariance method) for a portfolio containing stocks, bonds, and an ETF. Additionally, there is a put option (out of the money) that is there to hedge the downside risk of my position in the ETF. The ETF tracks the MSCI index. My question is, how do I implement the...
I'm sure there's an obvious answer to this question so apologies. But reading through this seminal paper on the SABR model, the author's provide an explicit formula for the (normal) implied vol of a $\tau$-expiry, strike $K$ option, $\sigma_N(K)$ (ibid. equations A67a,b). For the case $\beta=0$ (i.e. for a Bachelier di...
Ok, this is a bit of a long read, so be warned.. I am currently learning about the so called "Stochastic collocation" technique which seem to have been quite popular during recent years for different applications in finance. To get some feeling for the method I have made an attempt to implement the method used in the a...
For example, what does "outright" mean in outright OIS swap? Another similar question, what does "USD fedfund is marked as outright" mean? Thank you
I've been analyzing Tesla stock American options data and have observed an interesting pattern that I'd appreciate some help understanding. For this analysis, I obtained the Implied Volatilities (IVs) by reversing the Binomial Option Pricing model specific to American options and used the current market price derived v...
Many year ago, I worked on the pricing of IR products (Floating rate swap, CMS swap, Cap, Floor,...) Libor rates are now replaced by SOFR rate. I would like to know What are the new IR products (Floating rate swap, CMS swap, Cap, Floor,...) after the replacement of Libor rates by SOFR rate? And how are these new IR pr...
In the binomial tree options pricing literature, I see frequent reference to the definition that $$ u = e^{\sigma \sqrt{n/t}} $$ I think I understand the model, but how do we derive this, i.e. how do I fit the model to data? I've tried to derive it myself but get a different answer, namely $$ u = \exp(\sigma / 2\sqrt{n...
I'm trying to improve my understanding of valuation under collateralisation. One point that is made within multiple sources is for an uncollateralised derivative, how a future cashflow is equivalent to a loan made to that counterparty, and how the holder of the derivative must take that loan. I just can't see this equi...
Upvar and downvar swaps are examples of conditional variance swaps. For example a downvar swap only accrues variance for day $i$ (the day whose logarithmic return is $\log S_i/S_{i-1}$) if the underlying $S$ is below a threshold level $H$. This condition can be definded in 3 ways: $S_{i-1} \le H$, $S_{i} \le H$, Both ...
(Note there are similar questions, with different focuses at this forum, but my focus is more on the general concept, if any, about backtesting (for stocks) and sources of information where I can go to, if any, sorry if any duplicates) I have started to use a backtesting system for the local stock market (Taiwan), I do...
I've googled and read many articles about "ROIC" and "Invested Capital", but I'm still confused about how to calculate them. The best explanation I've seen so far is: Invested Capital (from CFI) Invested Capital Formula (from EDUCBA) Invested Capital Formula (from WallStreetMojo) There are at least two ways to calcu...
In this paper Elliott, R., van der Hoek, J. and Malcolm, W. (2005) Pairs Trading., the spread (state process) is assumed to follow a mean reverting process $x_{k+1}-x_k=(a-bx_k)\tau+\sigma\sqrt{\tau}\varepsilon_{k+1}$, and the observed spread is assumed to follow a (observation) process $y_k=x_k+Dw_k$. In section 2.3, ...
I try to compute the local volatility in python in both formula, i.e. in terms of call price surface and total variance surface. However, I get 2 different values. What did I do wrong? import numpy as np from scipy.stats import norm today=44935 date1=44956 t1 = (date1-today)/365 a1=0.00403326433586633 b1=0.0393291646...
I struggle to understand why my market rates does not match my bootstrap model. So I wonder why the spread is that high between market & model. maturity | market | model 1W | 0.050640 | 0.050626 2W | 0.050670 | 0.050631 3W | 0.050720 | 0.050655 1M | 0.051021 | 0.050916 2M | 0.051391 | ...
Background: I am currently implementing a correlated Monte Carlo simulation model using Cholesky decomposition to create the sampling distribution. Question: What is the difference between creating and sampling an aggregate distribution of correlated assets and simply creating a univariate simulation based on the portf...
I have experimented a bit with the SABR model. In particular I have calibrated it on EURUSD. Obviously, as SABR is a 3 parameter model, it will not fit the 5 market quotes consisting of ATM, 25 delta butterfly, 10 delta butterfly, 25 delta risk reversal and 10 delta risk reversal perfectly. If I ignore the 10 deltas in...
We have a regular self-financing portfolio $W_t$: $$dW_t = n_t dS_t + (W_t − n_t S_t) r dt$$ Where $W_t$ is total wealth, $n_t$ is amount of stock, $S_t$ is stock price, $r$ is the risk-free rate. And the strategy is to keep the stock exposure φ constant: $φ = n_t S_t/W_t$ Currently I'm having trouble while trying to d...
I have recently struggled in interviews, for two quantitative trading positions, by producing weak answers to effectively the same (fairly basic) question. I would like to understand, from a quant perspective, what I am missing about multicollinearity. The question assumes you have a large portfolio of assets (say n=10...
In the context of pair trading, I’m trying to regress a VEC model on cointegrated pairs (and also a GARCH model on the residual of that VEC model).I would like to generate random réalisations of each pair, each realization having the same dynamic as its “real life” counterpart. What I did initially is that I generate r...
I am currently reading "Modelling single-name and multi-name credit derivatives" by Dom O'Kane but I struggle at one point that should be relatively easy. Let us consider a Zero Recovery Risky Zero Coupon Bond, that is to say a bond that pays 1 in case there is no default $\tau > T$ (that is the time of default arives ...
Let us consider a product paying an amount of 1 if default (τ<T that is the time of default arrives before maturity time), and 0 otherwise. The payoff of such a product would be given by: $$D(0, T) = E\left(\exp\left(-\int_0^\tau r(t)dt\right) \cdot \mathbb{1}_{\tau \leq T}\right)$$ Knowing that: $$\text{Probability}(T...
I've been reading about multi-armed bandits and the explore/exploit trade-off that can be solved with dynamic allocation indices such as the Gittins Index Theorem. Could this be applied to when to change investment/trading strategies assuming no cost in switching such strategies? If the fund's risk aversion is an issue...
I am trying to implement MonotoneConvex by Hagan/West by extending FittingMethod class. As per this page: https://rkapl123.github.io/QLAnnotatedSource/d7/d0d/class_quant_lib_1_1_fitted_bond_discount_curve_1_1_fitting_method.html#details I need to override discountFunction() and size(). Is this possible through QuantLib...
I have been using the CrossCurrencyBasisSwapRateHelper feature to generate a colateralised discounting curve where the collateral is in a currency different to that of the asset. However, I noticed that this feature has now been deprecated and no longer available although it is still listed under the 'Helpers' section ...
I am reading Euan's book, ‘positional option trading’ and have a question about risk reversal P/L example. Here is description 'Consider a 1-month risk reversal on a \$100 stock. The 20-delta put (91 strike) has an implied volatility of 40.8% and the 20-delta call has an implied volatility of 23.1%. We sell the put and...
I'm currently working on building a yield curve using OIS swaps. However, I'm encountering an issue with the cash flow start date that I'm struggling to understand. Here's a simplified version of my code: Reproducible example import QuantLib as ql calculation_date = ql.Date().todaysDate() #When I posted this on Quant ...
Disclaimer: I understand this is a basic question that gets addressed in most 101 textbooks. Yet I have reviewed many of them not finding a satisfactory answer. Please bear with my ignorance. Suppose a forward contract enforces the parties to exchange an asset with price $K$ at the delivery date $t=T$, and suppose the ...
In his book (chapters 9.5 to 9.7), Peter Austing argues that barrier options are insensitive to the details of the stochastic volatility model used in a LSV model, except for the level of vol of vol. In particular, he claims that there is no point in including a spot-volatility correlation in the stochastic volatility ...
I'm looking for an easy method to approximate the probability of the forward swap rate that is implied by the swpation market. One possibility would be to fit a certain model, e.g. SABR, and extract the risk neutral density. On the other hand I know from the equity case that $N(d_1)$, the delta, is used an approximatio...
We know that a market is called complete if it is possible to replicate any future payoff trading in its securities. Is there an exhaustive list of requirements that when satisfied imply market completeness? Is perfect competitiveness one of those?
This question is a follow-up of this question Fixed Payment at Default - Pricing for more clarity. Starting from the following expression of payoff: $$ D(0,T) = E(\exp(-\int_{0}^{\tau} r(t)dt) \cdot \mathbb{1}_{\{\tau \leq T\}}) $$ and knowing that $$ \text{Probability}(T \leq \tau \leq T+dT) = \lambda(T) \cdot \exp(-\...
I have been attempting to bootstrap zero rates using quantlib, but I am perplexed by the significant discrepancies between my calculated zero rates and those obtained from Bloomberg's bootstrapping process. I would greatly appreciate any insights or suggestions regarding potential reasons for this mismatch. Below is th...
I am currently working on pricing a Zero Coupon Inflation Swap using Quantlib in Python. During my analysis, I have observed that when the start date and end date of the swap coincide exactly with X years from the valuation date (e.g., a maturity date of March 31, 2041), and I'm pricing the swap on the same date (e.g.,...
For focus, let us restrict the scope of this to vanilla options-based positions/strategies. In a lot of the accounts that I've seen of those that engage in this sort of investment/trading strategy (Nassim Taleb, among others), from my view, the entry conditions seem relatively apparent, e.g., potentially, one either co...
In this preprint on arXiv (a revised version of the one discussed in a post here) we show that there are three mathematical mistakes in the option pricing framework of Black, Scholes and Merton. As a result, the option pricing formula seems incorrect even under the idealized capital market assumptions of Black and Scho...
Let $H$ be an investment strategy in a discrete price model. Proof $H$ is self financing if and only if the following holds for the portfolio process $P_t$: $$P_t = P_0 + \sum_{s=1}^tH_{s-1}(X_s-X_{s-1}) \quad \forall t=1, \dots,T$$ $\textbf{Definition:}$ $H_t$ self financing strategy $\iff (\Delta H_t)^TX_{t-1}=0\...
I have read somewhere the following statements, which I have observed to be true most of the time. I want to know how accurate they are mathematically, and how to prove them? $\Gamma > 0$ is a good position to be in, and therefore you have to pay a premium for it, on the other hand $\Gamma < 0$ is a bad position to be...
Background: I'm building a trading system for the crypto market with Python, and currently having problems on how to effectively save my real time orders/trades to disk, so that I could monitor more easily or do further analysis afterwards. The current design is as follows: For each asset I have a Strategy class, with ...
I'm reading M. S. Joshi's paper "Log-Type Models, Homogeneity of Option Prices and Convexity", and I'm having problem understanding equation 1: $$ C(S_0, K) = \int (S - K)_+ \Phi\left(\frac{S}{S_0}\right)\frac{dS}{S} $$ Could anyone help? I can only write down $$ C(S_0, K) = \int (S - K)_+ \phi(Z)dZ $$ where $S = S_0 e...
I am looking for references or practical solutions for the following. In the usual factor approach for equities with panel data regression (for each stock, explain future returns given stock characteristics), how do I add industry specific models? Example: I have 500 stocks and some stock factors are general like the s...
As part of my research for my masters thesis, I'm testing out the effectiveness of some different models in Monte Carlo simulations for path dependant options. I will be attempting a model-free approach to simulating price paths so these will simply be used as a benchmark. I want to choose a few models which are valid ...
Consider the Gamma-Ornstein-Uhlenbeck process defined in the way Barndorff-Nielsen does, but consider a different long running mean $b$ which may be bigger than zero: $$dX(t) = \eta(b - X(t))dt + dZ(t)$$ Where $$Z(t) = \sum_{n=1}^{N(t)}J_n$$ With $N(t)$ being Poisson($\lambda t$) and $J_n$ iid Exponential($k$) This has...
I've been using QuantLib for constructing a yield curve and pricing a bond. I am wondering if I'm using the correct method to create my yield term structure (yts) for the pricing process. Here is the reproducible example : import QuantLib as ql import math calculation_date = ql.Date().todaysDate() ql.Settings.instanc...
I'm currently reading this paper "Explicit SABR Calibration through Simple Expansions" by Fabien Le Floc'h and Gary Kennedy and in the 3rd part when they introduce Andersen & Brotherton-Ratcliffe expansions, I can't manage to get the same results as they get with the parameters they use when the strike is different fr...
I was wondering if there exist options or other derivatives that do not have a known closed-form analytic expression (i.e., some sort of Black-Scholes PDE) and are usually priced using Monte Carlo methods, but that could have such an expression? Specifically, I am wondering if it is possible to analyze the price data o...
I have a silly question regarding complex calculus, in which I'm a bit rusty at the moment. In F. Rouah's book The Heston Model and Its Extensions in Matlab and C# the following appears: Now evaluate the inner integral in Equation (3.32), as was done in (3.14). This produces $$\begin{align} \Pi_1 & = \dfrac{1}{2\pi}\...
I was wondering if the representation by Duffie, Pan, and Singleton (2000) is already accounting for the little Heston trap. DPS represent their 'general' discounted characteristic function as: $$ \begin{align} \psi(u,(y,v),t,T) = exp(\alpha(u,T-t) + yu + \beta(u,T-t)v), \end{align} $$ where $$ \begin{align} \b...
Suppose I have a factor model that takes in unemployment and GDP as $X_1, X_2$ respectively in estimating the fair price of asset $Y$. Say I observe that the market price of $Y$ has deviated significantly from the estimate from my model. My intuition says this signal cannot be used as a trading signal because while pri...
Let $\left(W_t\right)_{t\geq 0}$ be a Brownian motion with respect to filtration $\mathbb{F}=\left(\mathcal{F}_t\right)_{t\geq 0}$. Let $\left(\alpha_t\right)_{t\geq 0}$ be an $\mathbb{F}$-adapted stochastic process. What are necessary conditions to ensure that the stochastic integral $\int_0^t\alpha_sdW_s$ is a normal...
I am investigating various versions of nested and nonnested Fama and French factor models. Performance of the models is compared on the basis of Squared Sharpe Ratios. Bariallas et al. (2020, JFQA) propose a test that does only require the factors as inputs and does not rely on test assets. However, I can not quite get...
I'm trying to get a solution for the foreign equity call struck in domestic currency, where the foreign equity in domestic currency is defined as $S=S^fX^\phi$ with $0<\phi<1$, instead of the normal $S=S^fX$ (See Bjork 2020 for the standard setting). Here it would be incorrect to assume that $S$ has a drift of $r_d$ (d...
Roll's critique (Roll, 1977) can be summarized as follows (quoting Wikipedia): Mean-variance tautology: Any mean-variance efficient portfolio $R_{p}$ satisfies the CAPM equation exactly: $$ E(R_{i})-R_{f}=\beta_{{ip}}[E(R_{p})-R_{f}]. $$ Mean-variance efficiency of the market portfolio is equivalent to the CAPM equati...
I have the impression that asset pricing models such as the CAPM or Fama & French 3 factor model typically concern nominal rather than real (inflation-adjusted) prices/returns. If this is indeed so, why is that? Here is my guess. In cross-sectional asset pricing, there is no inherent time dimension (that is why it is c...
I'm learning QuantLib-Python and trying to replicate an Interest Rate Swap valuation on a custom curve constructed by passing lists of dates and discounting factors. Please see my code below import QuantLib as ql today = ql.Date(31, ql.May, 2023) ql.Settings.instance().setEvaluationDate(today) dates = [ql.Date(31, ql...
I'm using this formula to price sovereign CDSs according to CDS Returns, Augustin, Saleh and Xu (2020), Journal of Economic Dynamics and Control. As you can see, the highlighted part will become negative in the case the spread is lower than the coupon. I'm looking at 25bp coupon contracts, therefore prices often go ne...
I have a conceptual question regarding zero-coupon bonds. Say a bond issuer has issued a bond for funding itself, this bond has been split by the issuer (for simplicity assuming issuer is the same as market maker). The issuer sells the bond at a deep discount to the face value. This discount becomes the capital gains (...
I was reading Smile Dynamics II by Lorenzo Bergomi. It is clear to me that on page 2 $$ V_t^{T_1,T_2}=\frac{(T_2-t)V^{T_2}_{t}-(T_1-t)V^{T_1}_{t}}{T_2-T_1} $$ is the fair strike of a forward-starting variance swap that starts accumulating variance at $T_1>t$ and matures at $T_2>T_1$. However, I find it difficult to con...
In this question, I asked whether it is better to use clustered or GMM-based standard errors for estimating and testing asset pricing models such as the CAPM. However, I then realized that I am not sure how to set up the panel data model needed for obtaining the clustered standard errors, because the $\beta$s are unobs...
With time-constant expected value of market's excess return, we can estimate the CAPM using GMM as follows. Equation $(12.23)$ in Cochrane "Asset Pricing" (2005) section 12.2 (p. 241) says the moments are $$ g_T(b) = \begin{bmatrix} E(R^e_t-a-\beta f_t) \\ E[(R^e_t-a-\beta f_t)f_t] \\ E(R^e-\beta \lambda) \end{bmatrix}...
I am not able to make quantlib match bloomber price, maybe I don't use the right parameters into ql.Schedule or ql.FixedRateBond I have a price of : 90.012 instead of 93.508 [Huge spread between my result and bloomberg] Below is the reproducible example : import QuantLib as ql todaysDate= ql.Date(2,6,2023) ql.Setting...
I need a fast package for backtesting in R. I'm going to optimize a lot so I'll be running my strategies many millions of times. I know about packages like quantstrat or SIT but they are terribly slow for my purposes, I have one strategy, I'm not going to model 20 portfolios at the same time and such. Which package can...
I'm trying to calculate the total return (in %) on a 9% coupon 20-year bond with the following assumptions: reinvestment rate of 6% annually (3% every six months) terminal yield of 12% (semiannual rate of 6%) face value of the bond is 1000 Assume I buy the bond at par and hold it for 10 years. I keep getting 7.37% bu...
Is there a way to widen the 95% VaR by changing the distribution of a portfolio of stocks? When calculating 95% VaR of my portfolio using the holdings based approach (which requires the covariance matrix), more than 5% of the time it exceeds the upper/lower bounds. This is expected since in general the market has fatt...
Why the higher the fixed rate of a swap is, the higher the DV01 will be?
I am creating a RAROC/FTP model for different loan types on a credit union balance sheet. I am stuck on how to calculate the funding benefit of equity that would be netted out of my cost of funds benchmark. An example below shows the funding benefit @ 0.17%. Does anyone know where that may be sourced from or what calc...
Given the following SDE: $$ d\psi_t = \rho dt + \mu \psi_t dX_t$$, where $G(t) = \rho t$, $\rho = \frac{1}{T}$ $\psi_0 =0$, $T=1$, $\mu > 0$ and $X_t$ is a standard Brownian Motion (assume we know one specific path of $\psi_t$). Further, $E$ denote the mathematical expectation and $1$ the indicator function. The goal i...
I am looking to do some basic portfolio constructions as an experiment to learn more about it. I have been researching a bit and what I have found is that one of the purposes of factors models (Fama-French e.g.) is that it would allow us to model the variance/covariance of the factor portfolios themselves rather than t...
I have return data on several stocks that is regressed on two models. If I now want to compare if the estimated alpha differences between the two models are different from 0, do I use a unpaired t-test or a paired t-test?
I have been reading AFML ( Marcos López de Prado ) and I am having trouble understanding snippet 3.1 which provides the following code: def getDailyVol(close,span0=100): # daily vol, reindexed to close df0=close.index.searchsorted(close.index-pd.Timedelta(days=1)) df0=df0[df0>0] df0=pd.Series(close.inde...
At its most basic the volatility of an instrument is the standard deviation of its return series over time calculated as percentage change of the price series. How would this work for interest rate swaps where the "price" is a rate and is expressed as a percentage? I would be inclined to proceed using the percentage ch...
My question is about chapter 3 in the ninth edition of "Options, futures and other derivatives" by John C. Hull, subchapter 5 under the heading "Changing the Beta of a Portfolio". In the final paragraph, they explain how one can reduce the Beta of a portfolio by reducing the number of short contracts proportional to th...
If I run the below CDS pricing example (from https://github.com/lballabio/QuantLib-SWIG/blob/master/Python/examples/cds.py) using the UpfrontCdsHelper instead of the SpreadCdsHelper, I get the following error if I try to rerun for an earlier date relative to the initial date I used (e.g. rerun for May 15, 2006 after ru...
In the context of interest rate derivatives, we often speak of the spot date. But of course, there is not a "the" spot date, because there are multiple spot dates, for example for different currencies. There isn't necessarily even a single spot date for a currency. For example, SOFR and USD LIBOR swaps both have a two-...
I came across this passage in a book about PCA and denoising of Markowitz: But eigenvalues that are important from risk perspective are least important ones from portfolio optimization perspective. Information matrix mixes the returns and has Reciprocal values 1/λ k of the eigenvalues of the covariance matrix λ . This...
I know there is a large controversy about whether or not technical trading rules are profitable and research results depend on asset classes, time frames, trading costs, risk-adjusted return calculation, etc. Compared to this complexity it seems rather simple to statistically test, if resistance levels exist. One would...
Has anyone seen R script for GMM estimation and testing of asset pricing models such as Fama-French 3-factor or similar? Ideally, I would like to have R scripts corresponding to Cochrane "Asset Pricing" (2005) chapter 12 and related chapters. Now, I have looked around and found some bits for the CAPM (including in the ...
I am trying to figure out whether an options structure is short or long skew without just having someone tell me the answer. I'd like to calculate the number myself. Assuming I am creating a risk reversal at strike 90, 110: for strike 110: skew = IV of call @ strike 110 - IV of call @ strike 111 for strike 90: skew = ...
Can anyone help me with the stochvol package in R? I estimated the volatilities using this package but I am not being able to understand how to download the estimated volatilities. I used volplot function to plot the volatilities but not understanding how to download that output. I have used the following code. When I ...
Is there a practical way to calculate a delta threshold for rebalancing when gamma scalping? I know it does not effect expected P&L, but what about optimizing for P&L sharpe ratio after transaction costs?