instruction
stringlengths
15
26.1k
I have a portfolio optimization problem similar to [this question][1] here, with a V-shape transaction costs such that we pay a fee proportionally to the sum of absolute rebalancing: $$TC(\omega) = \frac{1}{2} |\omega-\omega_\text{old}|' \cdot \gamma$$ where $$\omega : \text{target portfolio to optimize},$$ $$\omega...
I am reading Lorenzo's Bergomi's book _Stochastic Volatility Modeling_, and I have come to this passage.[![enter image description here][1]][1] I just would like to understand the derivation between the first and the second equality. I guess I just have to "correctly" re-express the integral and then use Fubini's th...
To answer strictly: no there's no reference method for determining the number of days. ### Delving a bit deeper Always remember **the profit from option trading does not come from the price at which you trade but from the mismatch between implied volatility and realised volatility**. Moreover, **you can reap tha...
At least two ways to price this: 1. Use Carr-Madan 2. Use $S^2$ as a (power) numeraire, in which case you can price the payoff $(S_T - 1)_+$ under the power numeraire measure. EDIT: 3. Put-call symmetry. Maybe I can get another -1 for my answer. Is the purpose of answering questions here to do homework for...
Literature on realized volatility and sampling frequency?
At least two ways to price this: 1. Use Carr-Madan 2. Use $S^2$ as a (power) numeraire, in which case you can price the payoff $(S_T - 1)_+$ under the power numeraire measure. EDIT: 3. Put-call symmetry. Maybe I can get another -1 for my answer. Is the purpose of answering questions here to do homework for...
At least two ways to price this: 1. Use Carr-Madan 2. Use $S^2$ as a (power) numeraire, in which case you can price the payoff $(S_T - 1)_+$ under the power numeraire measure. EDIT: 3. Put-call symmetry. Maybe I can get another -1 for my answer. Is the purpose of answering questions here to do homework for...
At least two ways to price this: 1. Use Carr-Madan 2. Use $S^2$ as a (power) numeraire, in which case you can price the payoff $(S_T - 1)_+$ under the power numeraire measure. EDIT: 3. Put-call symmetry. Maybe I can get another -1 for my answer. Is the purpose of answering questions here to do homework for...
At least two ways to price this: 1. Use Carr-Madan 2. Use $S^2$ as a (power) numeraire, in which case you can price the payoff $(S_T - 1)_+$ under the power numeraire measure. EDIT: 3. Put-call symmetry. Maybe I can get another -1 for my answer. Is the purpose of answering questions here to do homework for...
At least two ways to price this: 1. Use Carr-Madan 2. Use $S^2$ as a (power) numeraire, in which case you can price the payoff $(S_T - 1)_+$ under the power numeraire measure. EDIT: 3. Put-call symmetry. Maybe I can get another -1 for my answer. Is the purpose of answering questions here to do homework for...
At least two ways to price this: 1. Use Carr-Madan 2. Use $S^2$ as a (power) numeraire, in which case you can price the payoff $(S_T - 1)_+$ under the power numeraire measure. EDIT: 3. Put-call symmetry. Maybe I can get another -1 for my answer. Is the purpose of answering questions here to do homework for...
I'm reading about volatility modelling and I came across the concept of parametric and non-parametric models. For example, GARCH is a parametric model and Realized Volatility is a non-parametric model. As far as I can tell, parametric models assume the data has certain shape and have some parameters that need to be ...
What is the difference between non-parametric and parametric models?
What is the difference between parametric and non-parametric models?
I am a beginner to finance, today I found a question looks very simple that I am not quite sure about it. Question: Given I am paid \$50,000 now, growing at $6\%$ per year for a total of 10 years, but the discount rate is $4\%$, solve for the present value. My thought is first calculating the nominal value in 10...
I read the following paragraph from investopedia: https://www.investopedia.com/terms/c/convexity.asp If a bond's duration increases as yields increase, the bond is said to have negative convexity. In other words, the bond price will decline by a greater rate with a rise in yields than if yields had fallen. Therefore,...
I would like to get a table of the form symbol | open | close | high | low A | 90.32 | 89.81 | 90.58 | 89.46 AA | 12.51 | 12.17 | 12.61 | 11.93 AAAU | 17.20 | 17.35 | 17.35 | 17.09 ⋮ ⋮ ⋮ ⋮ ⋮ ZYME | 37.77 | 36.16 | 38.00 | 36.50 ZYNE | 5....
Can I download today's open/close/high/low data for all stocks (in bulk) for free?
Hi I haven't understood if I can apply the CVA just for derivatives or I can estimate the PD from CDS spreads and apply these in a bonds portfolio for the CVA calculus. The CVA literature refers to "counterpart risk", but if I use the PD calculated from the CDS spreads I've the "reference entity risk", can I use this ...
Can I calculate the CVA or DVA over a sovereign portfolio?
I would like to get a table of the form symbol | open | close | high | low A | 90.32 | 89.81 | 90.58 | 89.46 AA | 12.51 | 12.17 | 12.61 | 11.93 AAAU | 17.20 | 17.35 | 17.35 | 17.09 ⋮ ⋮ ⋮ ⋮ ⋮ ZYME | 37.77 | 36.16 | 38.00 | 36.50 ZYNE | 5....
I would like to get a table of the form symbol | open | close | high | low A | 90.32 | 89.81 | 90.58 | 89.46 AA | 12.51 | 12.17 | 12.61 | 11.93 AAAU | 17.20 | 17.35 | 17.35 | 17.09 ⋮ ⋮ ⋮ ⋮ ⋮ ZYME | 37.77 | 36.16 | 38.00 | 36.50 ZYNE | 5....
Can I download today's open/close/high/low data for all stocks (in bulk)?
Suppose that we have a one step binomial tree model for a company. Lets say that the time per step is T, and that price of the stock can go up to $p_1$ or go down to $p_2$. Suppose a T-month European call on the company, with strike price $X$ trades at price $Y$ while a T-month European put with strike price $W$ has a ...
I have attempted to use the fact of having implied volatility, but have not been able to come up with a viable way to calculate the probability, any ideas? Suppose that a stock $S_t$ follows a lognormal model and that on May 29,2019 the closing price of the stock was $S_0$ was 61.5 and the implied volatility of the op...
I am really confused on the usage of the greeks and the Black-Scholes model for option pricing. To gain some more understanding I am attempting to see if I can price a european call option under the following circumstances. If the underlying stock is currently selling for 70, the stock pays dividends continuously prop...
I have a CSV which looks like this. Ticker | Buy Date | Sell date AAPL | 2018-01-03 | 2019-03-30 TSLA | 2019-03-01| 2019-04-05 What’s the best way to backtest this CSV performance given that every stock is given equal weight? Looking for a software or python script.
What’s the best Backtest Software/method?
What instrument(s) are used for forward pricing of US Treasuries? I know that Eurodollar futures are used for the market pricing of Libor in the future, but treasury futures only have contracts 3 months out. I am looking at forward swaps but I'm not sure if this is truly the market's reflection of future treasury pr...
My question is (I think) about the correct syntax of the code. egarch = arch_model(train_data, mean='zero', lags=0, vol='EGARCH', p=1, o=1, q=1, dist='normal') egarch_fit = egarch.fit(); prediction = egarch_fit.forecast(horizon=1); print(prediction) I expected the final line to print a numeric ...
How to obtain one-step ahead forecast in Python based on GARCH?
I am trying to produce one-step ahead forecast using GARCH in Python using a fixed windows method. I ultimately want to put the code below in a for loop, but this code snippet does not perform as I expect. egarch = arch_model(train_data, mean='zero', lags=0, vol='EGARCH', p=1, o=1, q=1, dist='normal') egarc...
I am trying to produce one-step ahead forecast using GARCH in Python using a fixed windows method. I ultimately want to put the code below in a for loop, but this code snippet does not perform as I expect. egarch = arch_model(train_data, mean='zero', lags=0, vol='EGARCH', p=1, o=1, q=1, dist='normal') egarc...
I understand the basic trade lifecycle but I can't find more information on how clearing and settlement works. To my knowledge, if I buy VOD LN executed on LSE - this will be cleared by LCH which is owned by LSE? Does this not defeat the purpose of having an independent Central Clearing Party in the first place? In...
How does clearing and settlement work in Europe?
**Edit**: **is there any work published on Numeraire being correlated to one of the traded assets? I haven't found a single paper online on this topic. If anyone has links to any resources on this topic, could you please share?** The Fundamental Theorem of Asset Pricing states that: \begin{align*} \frac{X_0}{N_0...
Quantlib : How to resolve ' more than one instrument with pillar' in valuing swaps?
I'm reading the book Financial Markets Under the Microscope to study market microstructure. There is a notation that I could not understand. What is the meaning of D here? It is not used in the text before and after that point. So I could not give meaning. Is it an operator? Thanks [![Financial Markets Under the ...
What is the meaning of this notation, D lag t?
I'm trying to derive optimal exercise boundary using LSM method and got some weird outcome. So, I evaluated an American call option by LSM method and now need to find the optimal exercise curve. Do I understand it correct that it is necessary to do the following: on each time step I have to solve non-linear equation...
I found 'enableExtrapolation' in many curve-building examples but can only guess. Can anyone help me to understand it? It will be perfect if there are examples to show how it works. Thank you very much!
Quantlib-Python: Can anyone help me understand how enableExtrapolation works?
For example, let us build a survival probabilities curve providing the survival probabilities for the first 5 years. today = ql.Date().todaysDate() dates = [today + ql.Period(n , ql.Years) for n in range(5)] survival_probabilities = [1.0, 0.99, 0.98, 0.97, 0.95] spcrv = ql.SurvivalProbabilityCurve...
I'm wondering how to precisely handle the quote convention of ON, TN, and S/N of FX quote. How to handle these convention in quantlib. Here is my code, is that correct? ```ois_dayCount = ql.Actual360() # USD convention settlementDays = 2 #OIS convention discount_term_structure = ql.RelinkableYieldTermStructureH...
I'm using quantlib to calculate a fair spread of Libor/OIS swap. I have read the reference of ql.Swap and ql.FloatFloatSwap. But the document is too vague. I totally can't understand what parameters should be used. Now I have a YieldCurve object of 3M Libor and a YieldCurve object of OIS rate. How can I calculate t...
I would like to find out if it is possible to reduce: - the Madan-Seneta Variance Gamma (VG) model; - the Barndorff-Nielsen Normal Inverse Gaussian (NIG) model to the standard Black-Scholes through a particular choice of parameters. 1. First of all, is it possible to do so? 2. If so, how exactly could it...
I would like to get a table of the form symbol | open | close | high | low A | 90.32 | 89.81 | 90.58 | 89.46 AA | 12.51 | 12.17 | 12.61 | 11.93 AAAU | 17.20 | 17.35 | 17.35 | 17.09 ⋮ ⋮ ⋮ ⋮ ⋮ ZYME | 37.77 | 36.16 | 38.00 | 36.50 ZYNE | 5....
Implied volatility is the volatility that when inputted in the Black-Scholes model, it returns the theoretical market price of a European option value. I understand that implied volatility is not observable. However, we have access to option value in real life. How is the option value calculated in real life? All th...
How are option values in real life calculated without volatility?
I was going over my notes from an Asset Pricing module yesterday and came across something interesting I hadn't thought about in a while. It was how Hedge Funds can over inflate their performance by not properly accounting for stale/out of date prices or late mark-to-marketing. And that when they evaluate their perform...
How do Hedge Funds account for returns from short selling?
Let us consider a payment schedule $\{t_1,\dots,t_n\}$. We have a series of co-terminal and co-initial swaps with coinciding float and fixed payment dates, accrual conventions and notionals $-$ the specific float rate does not matter. Let $B_t(t_i,t_n)$ be the value at $t$ of a Bermudan swaption on a swap starting on $...
Let us consider a payment schedule $\{t_1,\dots,t_n\}$. We have a series of co-terminal and co-initial swaps with coinciding float and fixed payment dates, accrual conventions and notionals $-$ the specific float rate does not matter. Let $B_t(t_i,t_n)$ be the value at $t$ of a Bermudan swaption on a swap starting on $...
How to build a portfolio following the Smart beta process by dividend?
It is well-known that on a non-dividend paying stock, it is suboptiomal to exercise an American call option earlier. In other words, both European and American call options on the same non-dividend paying stock worth the same. This can be proven using the Put-Call Parity. However, I am not sure about European an...
Under what conditions will both European and American put options worth the same?
It is well-known that on a non-dividend paying stock, it is suboptimal to exercise an American call option earlier. In other words, both European and American call options on the same non-dividend paying stock worth the same. This can be proven using the Put-Call Parity. However, I am not sure about European and...
It is well-known that on a non-dividend paying stock, it is suboptimal to exercise an American call option earlier. In other words, both European and American call options on the same non-dividend paying stock worth the same. This can be proven using the Put-Call Parity. However, I am not sure about European and...
How much money would it take to artificially inflate/depress a stock?
It is well-known that on a non-dividend paying stock, it is suboptimal to exercise an American call option earlier. In other words, both European and American call options on the same non-dividend paying stock worth the same. This can be proven using the Put-Call Parity. However, I am not sure about European and...
Thank you for your help everyone, and I apologise beforehand if this is a lousy or dumb question. I am looking to read up more on Quadratic Loss & Linex Loss, and forecast optimality. In my university text, we were told that the quadratic loss function is essentially the squared-error of the loss function, or squa...
How does Linear-Exponential Loss (Linex) function tend towards Quadratic Loss function?
Hmm... lots of confusing cross-currents here. EPS has many legion problems; but so too do "earnings" and the "per share" adjustment does matter. Let's start from first principles. How much would you pay for a stock? For simplicity's sake, let's assume that you could predict the future path of future earnings with s...
With $V$ American option value, $H$ holding (aka continuation) value, and $B$ bank account value, we have: $$V_N(S_N) = (K-S_N)^+$$ and for $i$ backwards from $N-1$ down to 0, we have: $$ H_i(S_i) = \mathbf{E}\left[B_{i}B_{i+1}^{-1}V_{i+1}(S_{i+1})|S_i\right]$$ $$ V_i(S_i) = \max (K-S_i, H_i(S_i)) $$ The...
With $V$ American option value, $H$ holding (aka continuation) value, and $B$ bank account value, we have: $$V_N(S_N) = (K-S_N)^+$$ and for $i$ backwards from $N-1$ down to 0, we have: $$ H_i(S_i) = \mathbf{E}\left[B_{i}B_{i+1}^{-1}V_{i+1}(S_{i+1})|S_i\right]$$ $$ V_i(S_i) = \max (K-S_i, H_i(S_i)) $$ The...
I know that the formula for covariance is <img src="https://latex.codecogs.com/gif.latex?\sum&space;p{_{i}}\ast&space;(r{_{1,i}}-E()r{_{1,i}})\ast&space;(r{_{2,i}}-E()r{_{2,i}})" title="\sum p{_{i}}\ast (r{_{1,i}}-E()r{_{1,i}})\ast (r{_{2,i}}-E()r{_{2,i}})" /> But this is for two securities. How do I find the cov...
How do i find the covariance between two portfolios?
With $V$ American option value, $H$ holding (aka continuation) value, and $B$ bank account value, we have: $$V_N(S_N) = (K-S_N)^+$$ and for $i$ backwards from $N-1$ down to 0, we have: $$ H_i(S_i) = \mathbf{E}\left[B_{i}B_{i+1}^{-1}V_{i+1}(S_{i+1})|S_i\right]$$ $$ V_i(S_i) = \max (K-S_i, H_i(S_i)) $$ The...
I'm working in the Avellaneda-Stoikov implementation using Python. My [implementation](https://github.com/fedecaccia/avellaneda-stoikov) reproduces the authors' results, but I don't know how to properly adapt the algorithm in order to consider a larger time horizon. From the equation r = s - q * gamma * sigma*...
I have the data of past 10 years of NIFTY (the National Stock Exchange of India) stock, futures and options and I want to show the lead-lag relationship (which reacts first, futures, options or stocks) among the three using cointegration test, VECM model and granger's causalty. The issue is that I don't know how to ...
Let $a_t $ be adapted to the filtration random process $a_t: P\{\int _0^T|a_t|dt < \inf \} = 1 $ and $ b_t \in M_T^2. \quad$ Under which conditions the random process $$X_t = exp\{\int _0^ta_sds+\int _0^tb_sdW_s\} \; t \in [0, T]\,$$ is martingale and under which submartingale ? As I understand, this is a famous exa...
Under which conditions the given random process is martingale and under which submartingale?
Let $a_t $ be adapted to the filtration random process $a_t: P\{\int _0^T|a_t|dt < \infty \} = 1 $ and $ b_t \in M_T^2. \quad$ Under which conditions the random process $$X_t = exp\{\int _0^ta_sds+\int _0^tb_sdW_s\} \; t \in [0, T]\,$$ is martingale and under which submartingale ? As I understand, this is a famous e...
I assume you are researching how quantitative dividend based portfolios are constructed. One example is the ETF VYM (Vanguard High Dividend Yield ETF). It tracks the FTSE AW High Dividend Yield Index. The [methodology document][1] for this index shows that it is based on dividend forecasts (not actual dividends) pro...
I assume you are researching how quantitative dividend based portfolios are constructed. One example is the ETF VYM (Vanguard High Dividend Yield ETF). It tracks the FTSE AW High Dividend Yield Index. The [methodology document][1] for this index shows that it is based on dividend forecasts (not actual dividends) pro...
I assume you are researching how quantitative dividend based portfolios are constructed. One example is the ETF VYM (Vanguard High Dividend Yield ETF). It tracks the FTSE AW High Dividend Yield Index. The [methodology document][1] for this index shows that it is based on dividend forecasts (not actual dividends) pro...
I use quantlib to bootstrap yield curve from deposit rate, future price and swap rate. But after I get curve, the date in curve.nodes() doesn't match the date of swap. Here is the code: ```calc_date = ql.Date(3,4,2020) ql.Settings.instance().evaluationDate = calc_date calendar = ql.UnitedStates() settlementDa...
Knowing that bond A is more liquid that bond B, i.e higher volumes are traded on bond A, does this information have any impact on the spread? Can we say that the large volumes traded on A will increase the spread between A and B? Does this work the same as online trading, e.g on Forex market, where EUR/USD will have ...
I assume you are researching how quantitative dividend based portfolios are constructed. One example is the ETF VYM (Vanguard High Dividend Yield ETF). It tracks the FTSE AW High Dividend Yield Index. The [methodology document][1] for this index shows that it is based on dividend forecasts (not actual dividends) pro...
## Intuition ## **Yes it is possible.** Both, the NIG and the VG process are exponential Lévy processes, i.e. they model the stock price via $S_t=S_0e^{X_t}$, where $X_t$ is a Lévy process. [Here's][1] a recent answer to the topic. Your question boils down to the following: if $X_t$ is a general Lévy process (VG, NIG,...
## Intuition ## **Yes it is possible.** Both, the NIG and the VG process are exponential Lévy processes, i.e. they model the stock price via $S_t=S_0e^{X_t}$, where $X_t$ is a Lévy process. [Here's][1] a recent answer to the topic. Your question boils down to the following: if $X_t$ is a general Lévy process (VG, NIG,...
## Intuition ## **Yes it is possible.** Both, the NIG and the VG process are exponential Lévy processes, i.e. they model the stock price via $S_t=S_0e^{X_t}$, where $X_t$ is a Lévy process. [Here's][1] a recent answer to the topic. Your question boils down to the following: if $X_t$ is a general Lévy process (VG, NIG,...
I am trying to create financial data as close as possible to that of asset returns. Using the R code I can collect some stock data and compute the return: library(quantmod) library(mgarchBEKK) start_date = "2015-01-01" end_date = "2020-01-01" getSymbols("GOOG", from = start_date, ...
I have the following doubt: How should the OIS fixed rate be considered in computing principal+interests at the maturity of the swap? I mean, if i.e. the swap lasts 4 day (without w.e. in the middle), and the day count convention is ACT/365, I've found both: P*(1+OIS*4/365) ([here][1]) and P*(1+OIS/365)^4 ([here][2]...
## Intuition ## **Yes it is possible.** Both, the NIG and the VG process are exponential Lévy processes, i.e. they model the stock price via $S_t=S_0e^{X_t}$, where $X_t$ is a Lévy process. [Here's][1] a recent answer to the topic. Your question boils down to the following: if $X_t$ is a general Lévy process (VG, NIG,...
On p. 3 of Lorenzo Bergomi's book on Stochastic Volatility Modeling, there is the following assertion: *Indeed, to a good approximation, the variance of returns scales linearly with their time scale, thus* $\langle(\delta S)^2\rangle$ *is of order* $(\delta t)$ *and* $(\delta S)$ *is of order* $\sqrt{\delta t}$. He t...
I am reading "Option, Futures and other Derivatives" by John C. Hull, and on Appendix chapter 13, he derives BSM formula from a Binomial Tree. When he builds U2, I just don't understood how to get equation 13A.5. Which method is being used to get it, and why "a", that is equal to "J" that is defined as quantity...
For data, the mean-variance model for portfolio optimization uses asset returns to minimize portfolio risk (covariance matrix), which is asset returns volatility, and sometimes simultaneously maximizes portfolio expected return. Both objectives are based on asset returns data. Is it possible to do asset allocation w...
Any portfolio theories not based on asset returns?
For some clarification, what assets are you allocating and what is the objective? Does it include stocks, bonds, real estate, etc.? Do you care about returns, volatility, drawdown, etc? Assuming the answers are yes and you are concerned with what is usually referred to as asset allocation, I would next ask why yo...
For some clarification, what assets are you allocating and what is the objective? Does it include stocks, bonds, real estate, etc.? Do you care about returns, volatility, drawdown, etc? Assuming the answers are yes and you are concerned with what is usually referred to as asset allocation, I would next ask why yo...
For some clarification, what assets are you allocating and what is the objective? Does it include stocks, bonds, real estate, etc.? Do you care about returns, volatility, drawdown, etc? Assuming the answers are yes and you are concerned with what is usually referred to as asset allocation, I would next ask why yo...
I know how to minimize a linear function $f : \mathbb{R}^{n} \rightarrow \mathbb{R}$ with CVXPY but in my problem the function $f$ is quadratic and hence the problem is now in the form : $$\lVert AW-b\rVert_{2}$$ where A is a $N\times N$ matrix which depends on the vector W. More specifically, my full problem is ...
I know how to minimize a linear function $f : \mathbb{R}^{n} \rightarrow \mathbb{R}$ with CVXPY but in my problem the function $f$ is quadratic and hence the problem is now in the form : $$\lVert AW-b\rVert_{2}$$ where A is a $N\times N$ matrix which depends on the vector W. More specifically, my full problem is ...
Let say you have measured a Sharpe Ratio of $S^*$. What is the simplest way (ie no fancy distributions) to do a hypothesis that this is different from $0$? So $H_0: \text{ The sharpe ratio is equal to 0}$ and $H_1: \text{ The sharpe ratio is greater than 0}$. So given $S^*$, $\mathbb{P}( Y = S^* ) \geq 0.05$ B...
I can think of two. First up is the naive Bayesian porfolio, ie run equal weights in the absence of any priors about any of returns, their volatility, correlations, or return-persistence. But then think ahead to the next step in the game. What do you do in 1,3,12 months time after the weights have evolved in line w...
I need to create a bond portfolio, hedge it with duration / convexity and simulate yield shocks to . How would you proceed when creating the bond portfolio? Government or Corporate Bonds (or mixed?) Coupon or Zero Coupon Bonds (or mixed?) Short/long term bonds? Bonds from 1 Country / multiple Countries / from 1...
What's the best way to create a Bond Portfolio for Duration and Convexity hedging?
Any suggestions for books that cover topics such as the ones mentioned above? The purpose is for banking, risk management, model validation of models such as credit risk and other types of risk.
Combinatorial purged cross-validation (CPCV) is a technique for backtesting strategies while purging and embargoing observations in a time series, improving upon classical k-fold and walk-forward cross-validation. My understanding is that cross-validation is a process that *generates* univariate dataset/time series ...