instruction
stringlengths
15
26.1k
negative portfolio variance? Creating a positive semi definite matrix in excel
I am attempting a portfolio optimization model and ended up generating negative portfolio variance using 2Wa*Wb*σa*σb*correl(a,b) or 2WaWb*Cov(a,b) From reading the linked article where other users had an issue, I’m seeing that it is because the covariance matrix is not semi definite positive: https://quant.stack...
I'm new to R but experienced in Stata. I'm working on a research project involving 39 countries, each with 100+ years of daily financial data (date, high, open, close, return), along with USD exchange rates in separate CSV files. I need to create plots, summary statistics, and perform bootstrapping. My main concerns a...
(1) Does the rolling of bond payment from non-business days to the next or previous business day affect the coupon payment and the accrued interests within the coupon period? In other words, are the `adjusted` (bumped) or the `unadjusted` (unbumped) payment days used in the calculations? (2) Is there a correspondenc...
(1) Does the rolling of bond payment from non-business days to the next or previous business day affect the coupon payment and the accrued interests within the coupon period? In other words, are the `adjusted` (bumped) or the `unadjusted` (unbumped) payment days used in the calculations? (2) Is there a correspondenc...
How does Cash-Or-Nothing Call Option (Fix payoff if S > K) pricing formula behaves when volatility and interest rate both go zero? Say for the scenario of deep out of money (eg. S = 0.5 x K), or the scenario of deep in the money (eg. S = 2 x K)? My understanding is that when volatility goes zero, the underlying pric...
The Pive Capital Swap Spread Trades' case study (Fixed Income Securities from Pietro) suggested that in pricing a swap, using a swap curve appears to be the most reasonable methodology. However, he later said that we use data of LIBOR rates for maturities up to 6 months and then bootstrapping to find and derive the...
Should I use the yield curve or swap curve to find the value of my swap?
The PiVe Capital Swap Spread Trades' case study (in *Fixed Income Securities* from Pietro Veronesi) suggested that in pricing a swap, using a swap curve appears to be the most reasonable methodology. However, he later said that we use data of LIBOR rates for maturities up to 6 months and then bootstrapping to find ...
There are many funds (index funds or actively managed funds) that charge management fees, which inherently makes it underperform the asset it holds. There are some applications where finding the derivative value based on those funds is meaningful. I wonder was there an accepted way to find a risk-neutral measure ...
Ja, good question. Bear with me for a moment: I used to price options on funds in the context of variable annuity pricing/hedging. Basically a VA is a fund (actually fund of funds) with a guarantee component. The cost of the guarantee, and the management fees, is deducted from what is called the account value, which...
In an arbitrage-free single-period CRR model, the following options on a share are offered: [They are all European] (i) Call option at strike price $100$, price: $C_{0,1}=7.44$ (ii) Call option at strike price $110$, price: $C_{0,1}=3.72$ (iii) Put option at strike price $100$, price: $P_{0,1}=23.59$ (iv...
I know that calculations of yield to maturity(YTM) assume that all coupon payments are reinvested at the same rate as the bond's current yield and take into account the bond's current market price, par value, coupon interest rate, and term to maturity. [![YTM Formula][1]][1] [1]: https://i.stack.imgur.com/5jP...
How to calculate YTM in case coupon payments are reinvested at a different rate than the bond's coupon rate?
In my opinion it's a flawed argument because there is no reinvestment assumption in the ytm computation. Investopedia is not a reliable source generally. It is a common fallacy to state the reinvestment assumption. Some papers trying to address this problem. - [The controversial reinvestment assumption in IRR...
I have a question about the estimation method of the original paper of Fama and French (2015) regarding the five factor model and the t statistics. Are they using non-robust standard errors or are they using the HAC standard errors? In the paper Fama and French (1993) they argue that they use the method of Black et al....
The _assumption_ (not a _requirement_) of the IRR method (which is how yield is calculated) is that all cash inflows and outflows are borrowed/invested at the same constant rate to end up with the same amount of cash at the end of the stream. IRR (Yield) is simply that constant rate at which all cashflows are borrowed...
could any kind soul explain how are the Discount and Yield computed? Also, do they refer to “Discount Yield (daycount Act/360)” and “Yield (daycount Act/365)” respectively? Thank you! [![enter image description here][1]][1] [1]: https://i.stack.imgur.com/FgQMJ.jpg
How to compute Bloomberg T-Bill yield in BXT?
I'm trying to apply Hagan & West's monotone convex interpolation to a 6m EURIBOR (forward) curve using ESTR (already bootstrapped) for discounting. In their paper Hagan & West use discrete forward rates $f_i^d$ belonging to the interval $[\tau_{i-1},\tau_i]$ as input. They then try to identify and instantaneous for...
I have a time series of returns of an asset (call this $ X_t $) which I have verified to be stationary. Let's say I generate a new time series $Y_i$ which is a filtered version of $X_t$ (that is I remove some points from $X_t$ based on a specific condition to generate $Y_i$). Now, the thing to notice is that the points...
Let's say, for simplicity, I have a long-only portfolio $P$ that consists solely of equity. The average holding period for each asset is $n$ days. Are there research papers or theorems that investigate the relationship between the Sharpe ratio $S$ of the portfolio and the holding period $n$? Intuitively, I would ...
Let's say, for simplicity, I have a long-only portfolio $P$ that consists solely of equity. The average holding period for each asset is $n$ days. Are there research papers or theorems that investigate the relationship between the Sharpe ratio $S$ of the portfolio and the holding period $n$? Intuitively, I would ...
(More specifically on crypto exchanges) If traderA opens 1 long and traderB closes 1 long, thus delta Open Interest is 0. Then what if traderA opens 1 long, and traderB opens 1 short, is delta Open Interest = +1 or +2? There seems to be a bit mixed information on the web, and can't figure out the exact definition...
How is Open Interest calculated?
Every futures contract has a buyer and a seller. Open interest just counts the number of contracts people hold. If that number equals `100`, then there are that number of buyers and sellers. In your example, are traderA and traderB all the traders in the market? If so, they're trading the same contract and open in...
$final stock means the stock price at expiration. If a call option had to be purchased for more than the max($final stock - $strike,0) then you would never make money off buying the call option right? I found the no arbitrage assumption in Merton's Theory of Rational Option Pricing.
Can someone provide an example of how arbitrage would be used when an american call option can be bought for less than max($final stock - $strike,0)?
"$final stock" means the stock price at expiration. If a call option had to be purchased for more than the max($final stock - $strike,0)then you would never make money off buying the call option right? I found the no-arbitrage assumption in Merton's Theory of Rational Option Pricing.
"Final stock" means the stock price at expiration, and "strike" means strike price. If a call option had to be purchased for more than the max(final stock - strike,0)then you would never make money off buying the call option right? I found the no-arbitrage assumption in Merton's Theory of Rational Option Pricing.
Can someone provide an example of how arbitrage would be used when an american call option can be bought for less than max(final stock - strike,0)?
I'm trying to apply Hagan & West's monotone convex interpolation to a 6m EURIBOR (forward) curve using ESTR (already bootstrapped) for discounting. In their paper Hagan & West use discrete forward rates $f_i^d$ belonging to the interval $[\tau_{i-1},\tau_i]$ as input. They then try to identify and instantaneous for...
In Sheldon Natenberg's book "Option Volatiliy & Pricing (2nd)", he mentioned that (on page 65), **only trading days** (roughly 252 in a year) are counted when computing vol time and **all calendar days** (roughly 365 in a year) are used when computing interest rate (hence discount factor, borrow, forward, and etc.) ...
I'm trying to apply Hagan & West's monotone convex interpolation to a 6m EURIBOR (forward) curve using ESTR (already bootstrapped) for discounting. In their paper Hagan & West use discrete forward rates $f_i^d$ belonging to the interval $[\tau_{i-1},\tau_i]$ as input. They then try to identify and instantaneous for...
In Sheldon Natenberg's book "Option Volatiliy & Pricing (2nd)", he mentioned that (on page 65), **only trading days** (roughly 252 in a year) are counted when computing vol time and **all calendar days** (roughly 365 in a year) are used when computing interest rate (hence discount factor, borrow, forward, and etc.) ...
[![enter image description here][1]][1]"Final stock" means the stock price at expiration, and "strike" means strike price. If a call option had to be purchased for more than the max(final stock - strike,0)then you would never make money off buying the call option right? I found the no-arbitrage assumption in Merton's T...
Merton writes >Further it follows from conditions of arbitrage that >$$\tag{3}F(S,\tau;E)\ge{\rm Max}(0,S-E)\,.$$ >In genral , a relation like (3) need not hold for a European warrant. This is the well-known relationship between continuation value $F(S,\tau;E)$ of the *American* option and the payoff you get from...
Merton writes >Further it follows from conditions of arbitrage that >$$\tag{3}F(S,\tau;E)\ge{\rm Max}(0,S-E)\,.$$ >In general , a relation like (3) need not hold for a European warrant. This is the well-known relationship between continuation value $F(S,\tau;E)$ of the *American* option and the payoff you get fro...
At various informational websites about option trading, it is often mentioned that in order to compare different underlyings in an apples-to-apples comparison, it is useful to beta-weight the deltas. This way, deltas of various underlyings can all be “normalized” into the index deltas. As far as I understand, beta o...
Beta Weighting Deltas: What happens to the non-correlation part?
I have been doing reading and supposedly implied volatility of ATM options with 1-2 week expiries are reasonable vols to use as your $V_0$ when calibrating a Heston model. Firstly, why would it be unreasonable to take implied vol of a 1 year contract, and use that as your long-run vol, $\theta$ of the Heston model?...
Heston Calibration - how far OTM can an option be before it's not considered ATM anymore?
I am not being able to set the pillar date of an overnight interest swap helper to its maturity date. I have the following code: ``` valuation_date = ql.Date(24, 8, 2023) calendar = ql.UnitedStates(ql.UnitedStates.FederalReserve) spot_date = calendar.advance(valuation_date, 2, ql.Days) sofr = ql.OvernightInde...
A1: Volatility implied by what? :) A2: Check what the volatility smile is and how it affects your model.
(1) Does the rolling of bond payment from non-business days to the next or previous business day affect the coupon payment and the accrued interests within the coupon period? In other words, are the `adjusted` (bumped) or the `unadjusted` (unbumped) payment days used in the calculations? (2) Is there a correspondenc...
I studied Kelly portfolio and tangent portfolio and found that they have the same weights. But the empirical studies that I have seen so far show that Kelly portfolio has the smaller number of stocks with higher returns and higher variances. I do not understand how come this happens because the empirical study has to ...
If Kelly portfolio and tangent portfolio have the same weight. Are they differ only empirically?
A1: Volatility implied by what? :) A2: Check what the volatility smile is and how it affects your model. **UPD:** As @frido insisted, I would add more details. ### "Why not 1 year IV" Because processes are different. CIR distribution (Heston) is different from brownian motion (Black-Scholes). But you can ...
A1: Volatility implied by what? :) A2: Check what the volatility smile is and how it affects your model. **UPD:** As @frido insisted, I would add more details. ### "Why not 1 year IV" Because processes are different. CIR distribution (Heston) is different from brownian motion (Black-Scholes). But you can ...
A1: Volatility implied by what? :) A2: Check what the volatility smile is and how it affects your model. **UPD:** As @frido insisted, I would add more details. ### "Why not 1 year IV" Because processes are different. CIR distribution (Heston) is different from brownian motion with constant IV (Black-Schole...
Say that I correctly compute the sum of the cash flows of a given bond. How does this relate to the quoted price that most people understand? For example, based on the stream of cashflows of a bond with a face value of 10,000,000, I calculate a PV of 5,000,000; however, the bond trades above par at a clean price of 102...
Say that I correctly compute the sum of the cash flows of a given bond. How does this relate to the quoted price that most people understand? For example, based on the stream of cashflows of a bond with a face value of 10,000,000, I calculate a PV of 5,000,000. Yet, the bond trades above par at a clean price of 102. ...
I was reading about SABR Model and curious about this. The process of fitting the SABR model involves finding values for the parameters α, β, ρ, ν that minimize the difference between model-implied option prices or volatilities and market-observed option prices or implied volatilities. This is typically done using num...
A1: Volatility implied by what? :) A2: Check what the volatility smile is and how it affects your model. **UPD:** As @frido insisted, I would add more details. ### "Why not 1 year IV" Because processes are different. CIR distribution (Heston) is different from brownian motion with constant IV (Black-Schole...
Let's say that there's some asset traded on an exchange and that, for this asset, I have access to a snapshot of the limit order book (price level and quantity for bids and offers) and subsequent updates to the order book of this asset allowing me to reconstruct an approximation to the order book at a point in time as ...
How are order book and trade data consolidated/distilled into a more(?) tractable form for modeling?
I have been recently researching about portfolio optimization problems and it is unclear to me what is currently the state of art modeling choices when it comes to this topic. On one hand, I've researched linear factor models and linear programming. These approaches generally revolved around the idea of modeling th...
Linear programming and factor models vs M-V optimization?
Let's consider a straightforward example in which I possess a portfolio consisting of two stocks: $ R(t) = S_{1}(t) \cdot x_1 + S_{2}(t) \cdot x_2, $ Here, $t \in [0,T]$ represents the time index, $R(t)$ symbolizes the portfolio's value in terms of dollars, $x_i$ indicates the weight of stock $i \in [1,2]$, and...
How can this problem be defined formally?
The 2 year Treasury note yields ~4.9% in the cash market as of 29 Aug 2023. Assume implied cost of financing of 5.5% pa (3 month T-bill rate) to finance a long futures position. This results in a negative carry of ~0.6% pa if the world does not change. The 3 and 5 year Treasury note futures also have a negativ...
Why are long 2 year Treasury futures (ZT) trading at negative carry?
You're talking about the future Bloomberg calls 'ODA Comdty' (e.g. 'ODF21 Comdty'), and the BMF exchange calls DI1. It uses a non-linear contract multiplier. To convert from the quoted price to the notional contract value, you have to use the equation defined by the exchange, which is here: http://www.bmf.com.br/b...
I am looking for resources (if they exist) that explain the differences between quant finance software in academia and the real world, or explain how quant software is implemented in practice. For example, in uni we learn the Black-Scholes formula and how to write it out in code, which is fairly simple. e.g. ```...
I was reading Prof. Lopez book Advances in Finance ML and he uses a notation I could not understand. In 4.2 (Overlapping Outcomes) he says: > In Chapter 3 we assigned a label $y_i$ to an observed feature $X_i$, where $y_i$ was a function of price bars that occurred over an interval $[t_{i, 0}, t_{i, 1}]$. When $t_{i...
Taking a 1/50 sample seems erroneous to me. I'm not a quant, but I did work in an algorithmic trading team. I think the problem he is trying to solve with that heuristic is called "time series simplification". You can read about how big banks solve that problem here: [Time-series simplification in kdb+: a method...
I encountered an interesting formula a vendor gave me for how they calculate Average Net Price: Average Px = Weighted Average Price Average Px (Net) = (abs(warrant principal) + signed Fees and Commissions + Accrued) / filled quantity Warrant Principal = Market Value = filled qty * (`PRICING_MULTIPLIER` / `WRT_SH_P...
How do back office systems calculate warrant average net price?
Let's say that there's some asset traded on an exchange and that, for this asset, I have access to a snapshot of the limit order book (price level and quantity for bids and offers) and subsequent updates to the order book of this asset allowing me to reconstruct an approximation to the order book at a point in time as ...
Consider the derivatives trading activities of a bank and the trading of a derivative contract where the cash settles at some future point in time - 'buying' the derivative is a promise to pay some amount of cash at a _future_ date in exchange for receiving some commodity at that _future_ date, and vice versa for 'sell...
I studied Kelly portfolio and tangent portfolio and found that they have the same weights. But the empirical studies that I have seen so far show that Kelly portfolio has a smaller number of stocks with higher returns and higher variances. I do not understand why this happens, because the empirical study has to be bas...
If Kelly and tangent portfolios have the same weights, do they differ only empirically?
Just like to understand more between the model difference between 1d-Cheyette Model vs 1d-Markov Functional Model. Is there a model difference betweeen these 2?
I don't get why for calculating the carry of a spot staring swap I need to adjust the difference between the fixed rate and fixing by the Dv01? For example if I receive in a 5y swap and want to estimate the 6m carry i should do: 5y fixed rate = 4% float leg fixing = 2% Dv01 of 6m4.5y swap = 3 6m carry = (...
I don't get why for calculating the carry of a spot starting swap I need to adjust the difference between the fixed rate and fixing by the Dv01? For example if I receive in a 5y swap and want to estimate the 6m carry i should do: 5y fixed rate = 4% float leg fixing = 2% Dv01 of 6m4.5y swa...
Just like to understand more about the model difference between 1d-Cheyette Model vs 1d-Markov Functional Model. Is there a model difference betweeen these 2?
I am looking for resources (if they exist) that explain the differences between quant finance software in academia and the real world, or explain how quant software is implemented in practice. For example, in uni we learn the Black-Scholes formula and how to write it out in code, which is fairly simple. e.g. ```...
i was wondering how to create a comparison table across various time horizons for given currencies and see the return/spread over SOFR. Any Bloomberg links/functions i could use? Ideally i would like to create a set of short dated intruments, too, which would show me in this table the pick up vs. SOFR
How to modify the Heston Model such that we can modify the wings of the volatility surface?
we calculate the delta as change in NPV for 1% change in spot * 100. Would bumping up the forward price by same 1% produce the same results? I'm assuming F = S *exp(... ) or it's too simplifying assuming dividends?
I am attempting to replicate the work from "Individualism and Momentum around the World" (Chui, Titman, Wei, 2010, `https://onlinelibrary.wiley.com/doi/pdf/10.1111/j.1540-6261.2009.01532.x`). In Section VI (Other Determinants of Cross-Country Momentum: Regression Analysis), the author performs a Fama Macbeth regressio...
Let's consider a straightforward example in which I possess a portfolio consisting of two stocks: $ R(t) = S_{1}(t) \cdot x_1 + S_{2}(t) \cdot x_2, $ Here, $t$ represents the time index, $R(t)$ symbolizes the portfolio's value in terms of dollars, $x_i$ indicates the weight of stock $i \in [1,2]$, and $[S_{1}(t...
This seemed like the most appropriate stack exchange for this question even though the question isn't strictly quantitative, but I hope it's ok. I read an article(Article Below) and can't seem to understand how the unwinding of long BTC futures will prevent further downside/selling risk thus preventing further drop ...
How does unwinding of long BTC futures positions prevent further downside risk/decrease in prices of BTC/Crypto?
This seemed like the most appropriate stack exchange for this question even though the question isn't strictly quantitative, but I hope it's ok. I read an article(Article Below) and can't seem to understand how the unwinding of long BTC futures will prevent further downside/selling risk thus preventing further drop ...
This seemed like the most appropriate stack exchange for this question even though the question isn't strictly quantitative, but I hope it's ok. I read an article(Article Below) and can't seem to understand how the unwinding of long BTC futures will prevent further downside/selling risk thus preventing further drop ...
Does anybody know hot to get coin inflow/outflow volumes in Binance API? Or, may be, other open data sources how to get this data? Thank you! P.S. is supply/demand figures something different?
Binance crypto exchange inflow/outflow data, how to get?
I'm backtesting a pattern recognition strategy over 20 years across 40 futures markets. In my live trading portfolio, should I exclude all markets that made a loss over the 20 year backtest period?
I wolud like to know if there is an analytic formula to to valuate a up-knock-in forward, it means \begin{equation*} (S_{H_B}-S_T)1_{[H_B\leq T]} \end{equation*} where $H_B=\inf[t\geq0 | S_t=B]$ for some barrier $B>0$. Is possible under the Black-Scholes model compute in analytic way this derivative?. I have been...
I am attempting to replicate the work from "Individualism and Momentum around the World" (Chui, Titman, Wei, 2010, `https://onlinelibrary.wiley.com/doi/pdf/10.1111/j.1540-6261.2009.01532.x`). In Section VI (Other Determinants of Cross-Country Momentum: Regression Analysis), the author performs a Fama Macbeth regressio...
In the book Cartea and Jaimungal (Algorithmic and High Frequency Trading, page 249.), the midprice dynamics follows $ dS_t=\sigma dW_t+\epsilon^+ dM^+_t-\epsilon^- dM^-_t$ (10.22) where $M^+_t$ and $M^-_t$ are Poisson processes, with intensity $\lambda^+$ and $\lambda^-$ respectively. The jump size $\epsilon^\pm$ a...
What’s the Ito’s lemma compound Poisson process with two-sided jump and mean-reverting jump size?
In the book Cartea and Jaimungal (Algorithmic and High Frequency Trading, page 249.), the midprice dynamics follows $ dS_t=\sigma dW_t+\epsilon^+ dM^+_t-\epsilon^- dM^-_t$ (10.22) where $M^+_t$ and $M^-_t$ are Poisson processes, with intensity $\lambda^+$ and $\lambda^-$ respectively. The jump size $\epsilon^\pm$ a...
so the The Second Fundamental Theorem of Asset Pricing says: > An arbitrage-free market (S,B) consisting of a collection of stocks S and a risk-free bond B is complete if and only if there exists a unique risk-neutral measure that is equivalent to P and has numeraire B. I want to construct an example of a one-per...
In the book Cartea and Jaimungal (Algorithmic and High Frequency Trading, page 249.), the midprice dynamics follows $ dS_t=\sigma dW_t+\epsilon^+ dM^+_t-\epsilon^- dM^-_t$ (10.22) where $M^+_t$ and $M^-_t$ are Poisson processes, with intensity $\lambda^+$ and $\lambda^-$ respectively. The jump size $\epsilon^\pm$ a...
Why are finance costs excluded in capital budgeting?
I am dealing with a cross currency swap where the notional amount changes halfway through the strip accrual period, and I would like to know if there's a specific name for this structure? A stylized example below: Consider a vanilla AUDUSD CCIRS with a 5% fixed rate on the USD side with a 10m USD notional. Let's sa...
Is there a name a CCIRS structure where the notional amount changes halfway through the accrual period?
Let's consider a straightforward example in which I possess a portfolio consisting of two stocks: $ R(t) = S_{1}(t) \cdot x_1 + S_{2}(t) \cdot x_2, $ Here, $t$ represents the time index, $R(t)$ symbolizes the portfolio's value in terms of dollars, $x_i$ indicates the weight of stock $i \in [1,2]$, and $[S_{1}(t...