instruction
stringlengths
15
26.1k
I'm trying to create a script that, from standard OHLC data, finds patterns. The specific pattern i'm looking for right now is sideways movement after a move up, here is an example: [![][1]][1] [1]: https://i.stack.imgur.com/6RNq2.png So basically my code should detect when price is inside a box like the o...
I'm valuing a [rainbow option][1] numerically with a monte-carlo simulation and I'm getting some unexpected results. The price of a best-of call option is decreasing in price as correlation up to a certain point where it starts to increase, contrary to my intuition. The worst-of option case is much more well behaved wi...
I'm valuing a [rainbow option][1] numerically with a monte-carlo simulation and I'm getting some unexpected results. The price of a best-of call option is decreasing in price as correlation up to a certain point where it starts to increase, contrary to my intuition. The worst-of option case is much more well behaved wi...
You are considering two contracts: a Eurodollar futures contract with six months to maturity, selling at 5%, settled on three-month LIBOR, marked to market every day; and a Eurodollar forward contract with six months to maturity, selling at 5%, settled on three-month LIBOR Which contract do you prefer? I don't u...
What is the Risk Neutral Measure? I don't believe this has been answered on the internet well and with all the parts connecting. So: 1) What is the risk neutral measure/pricing? 2) Why do we need it? 3) How we calculate the risk neutral measure or probabilities in practice? 4) What connection has risk...
I'm valuing a [rainbow option][1] numerically with a monte-carlo simulation and I'm getting some unexpected results. The price of a best-of call option is decreasing in price as correlation up to a certain point where it starts to increase, contrary to my intuition. The worst-of option case is much more well behaved wi...
I'm valuing a [rainbow option][1] numerically with a monte-carlo simulation and I'm getting some unexpected results. The price of a best-of call option is decreasing in price as correlation up to a certain point where it starts to increase, contrary to my intuition. The worst-of option case is much more well behaved wi...
I'm valuing a [rainbow option][1] numerically with a monte-carlo simulation and I'm getting some unexpected results. The price of a best-of call option is decreasing in price as correlation up to a certain point where it starts to increase, contrary to my intuition. The worst-of option case is much more well behaved wi...
Can anyone help to explain why when the square root market impact model is used in the standard mean-variance optimization, the exponent becomes $\frac{5}{3}$ in the objective function? I suspect this has to do with expressing market impact in different units but I could not find a clear explanation.
I keep reading that "a step-up bond provides more protection to an investor in the face of market interest rate fluctuations", that "a step-up bond typically performs better than any other fixed-rate investment in a rising rate market", etc. To me, this appears completely wrong. Compared to a fixed rate bond (of th...
Step-up bonds should be more, not less sensitive to market interest rates, shouldn't they?
I'm trying to define and track the spread between two time series (data available [here][1]), for the purpose of learning pair trading basics. When running a cointegration test the two series seem to be cointegrated (using python's ```statsmodels.tsa.stattools.coint``` the results are ```(-3.3744261541141616, 0.04...
Why is OLS based spread not reflective of actual difference?
EDIT 2: I found the problem(s) and the prices seem to behave as expected now. For anyone interested there was a bug when normalizing the dependant ranom normal variates used in the simulation, so while they had the correct correlation one of them had a standard deviation of 1 and the other a standard deviation much gre...
I've heard this but I don't understand why. The demonstration of this is that the Ask Price of a Call Option is always higher than the difference between the Strike Price and the price of underlying stock. Why is this the case? And why should it be the case?
"The potential gain of a Call Option is always incorporated in the Option's price" - Why is that?
I'm trying to define and track the spread between two time series (data available [here][1]), for the purpose of learning pair trading basics. When running a cointegration test the two series seem to be cointegrated (using python's ```statsmodels.tsa.stattools.coint``` the results are ```(-3.3744261541141616, 0.04...
I am new to corporate finance and I ask myself why an investor is interested in being *short* an option? He can only can win a premium but he can lose much more. I understand with being a short, I cap the profits on a stock like this: ![enter image description here][1] I think this is a quite theoretical case, ri...
What is the benefit of holding a short option?
I have 2 approaches in my mind for finding a pde of an option that depends both on the short rate as well as the stock price- $V(t,r(t),S(t)$. Are these equivalent? 1. Find a hedging portfolio by shorting delta of the stock and delta ratio of the option to a ZCB. So my portfolio has the underlying stock, a ZCB, and ...
I have 2 approaches in my mind for finding a pde of an option that depends both on the short rate as well as the stock price- $V(t,r(t),S(t)$. Are these equivalent? 1. Find a hedging portfolio by shorting delta of the stock and delta ratio of the option to a ZCB. So my portfolio has the underlying stock, a ZCB, and ...
Suppose you are receiving a payment $K$ at time $t_m$. Let $p(0,t_i)$ be the maturity-$t_i$ zero-coupon bond price at $t=0$. If we consider a discrete time $\{0,...,t_m\}$, what would it mean to normalize the payment $K$ by the sum of the zero-coupon bond prices? In other words, is there an economic meaning behin...
Let's suppose I am starting to manage some money. The money is invested in ETFs, particular de VOO. Let's suppose I have *partner one* with 1,000 USD, and with this, I can buy 10 shares of VOO at 100 USD price per share. (not real price). My average price per share would be 100 USD. Then, another *partner 2* give...
How to calculate the net return of each "partner" at different times?
A question based from Springer's Stochastic Calculus for Finance II book - I've tried working this out, but keep ending up in circles. Let $S(t)$ be given by the usual formula for an asset price process with positive constants $\alpha$ and $\sigma$: $$S(t)=S(0)\exp\left(\sigma W(t)+\left(\alpha-\frac{1}{2}\sigma...
OIS are a series of fixed-rate cashflows discounted at the overnight rate, swapped for overnight (floating) rate. IRS are similarly discounted fixed-rate cashflows, swapped on an IBOR-floating rate. Since both of them are used to swap between fixed rate payment and float rate payment, can we think of OIS as shor...
I'm reading [this paper][1] relating to optimal investment with transaction costs where some value function $F(x)$ is optimized. At some boundary $x=u$ it will be optimal to pay a proportional cost $C$ which gives the boundary condition \begin{equation} F'(u) = -C \end{equation} The author argues that optimalit...
I'm looking to go into quantitative finance after my phd in around 2 years. With a background in pdes/numerics/heterogenous and distributed computing, I think my skill set is applicable in this area, and I'd enjoy the work. I don't have any financial background though, before my PhD I worked as a software engineer and ...
I'm trying to include interest rate derivatives in some Value at Risk calculations and am having trouble getting trustworthy values. My current approach is to look at the appropriate risk factor for the interest rate derivative, so for example I look at the 10-year treasury yield time series when handling a US treasury...
I'm trying to create a script that, from standard OHLC data, finds patterns. The specific pattern i'm looking for right now is sideways movement after a move up, here is an example: [![][1]][1] [1]: https://i.stack.imgur.com/6RNq2.png So basically my code should detect when price is inside a box like the o...
I need to calculate the yield of a 2 year Coupon Bond. Price = 98, Coupon = 3.5, N = 100. Now when I try to solve this, I arrive at the equation: $$ 98 = 3,5*e^{-y}+103,5*e^{-2*y} $$ But I can't figure out how to solve this equation for the yield y. I tried with Wolfram Alpha but don't know how to interpret the ...
> Develop a formula for the price of a derivative paying > >$$\max(S_T(S_T-K))$$ > > in the Black Scholes model. Apparently the trick to this question is to compute the expectation under the stock measure. So, $$\frac{C_0}{S_0} = \mathbb{E}[\frac{S_T\max{(S_T-K,0)}}{N_T}]$$ and taking $N_T = S_T$. We can ...
> Develop a formula for the price of a derivative paying > >$$\max(S_T(S_T-K))$$ > > in the Black Scholes model. Apparently the trick to this question is to compute the expectation under the stock measure. So, $$\frac{C_0}{S_0} = \mathbb{E}[\frac{S_T\max{(S_T-K,0)}}{N_T}]$$ and taking $N_T = S_T$. We can ...
Can anyone help to explain why when the square root market impact model is used in the standard mean-variance optimization, the exponent becomes $\frac{5}{3}$ in the objective function? I suspect this has to do with expressing market impact in different units but I could not find a clear explanation. EDIT: Near the...
Following the logic of [Ben-Meir and Schiff (2012)](https://arxiv.org/pdf/1204.3452.pdf) and this [question](https://quant.stackexchange.com/questions/30138/variance-of-a-straddle-black-scholes) the first, second, third and fourth raw moments of a put are: [![enter image description here][1]][1] Similarity, for a...
Following the logic of [Ben-Meir and Schiff (2012)](https://arxiv.org/pdf/1204.3452.pdf) and this [question](https://quant.stackexchange.com/questions/30138/variance-of-a-straddle-black-scholes) the first, second, third and fourth raw moments of a put are: [![enter image description here][1]][1] Similarity, for a...
If I want to lower the risk of the portfolion then the trivial thing to do is change from higher volatility to lower for a better Sharpe ration. It already lists the volatility for the stocks but the volatility for option type "bull certificate" is not listed. I don't expect it to be as simple as the leverage multiplie...
I'm working my way through the following paper: Malz. A. M. (2014). *A Simple and Reliable Way to Compute Option-Based Risk-Neutral Distributions* I am completely stuck on the following derivation. The author expresses the price of a call option at time-$t$ (with strike $K$ and on underlier $S_t$) as \begin{eq...
If I want to lower the risk of the portfolio then the trivial thing to do is change from higher volatility to lower for a better Sharpe ratio. It already lists the volatility for the stocks but the volatility for option type "bull certificate" is not listed. I don't expect it to be as simple as the leverage multiplied ...
Let's say you are building a simple model (like the classroom examples) of trying to predict, given past information, if the stock goes up or down in the future. One could, like in classroom examples, turn this into a classification problem, and encode 1 if stock goes up, 0 if unchanged, and -1 if stock goes down. ...
In your experience, when trying to predict something that occurs, do you model with a fixed time period?
Consider a stopping time $\tau$ that represents the point in time when the first credit event (e.g. default) occurs on a compact interval $[0,T]$. Consider the expectation of the indicator function, $\mathbf{1}_{\{\tau\leq T\}}$, under a well-defined filtered probability space,$(\Omega,\{F_t\}_{t\geq0},P)$: $$E_P...
I am currently holding a stock. I can see that the stock is trading at slightly above the future price. I don't expect it to pay any dividend for a while. Are there reasons that I should not sell my stock and then buy the future contract to retain my position? Assume I don't want to change my position. I am...
Should I sell my stock and buy future instead if the future price is smaller than the current stock price?
For the "mainstream" forex options for example those posted on this site: https://www.forexlive.com/orders/!/fx-option-expiries-for-thursday-july-02-at-the-10am-ny-cut-20200702 Do you know what type of forex options are posted in that site? Is it European option? American option? Barrier options? Others?
How does most Forex options work? What is the most liquid or popular type of forex options?
I am trying to calculate the bucket vega of the portfolio which includes mainly vanilla options and some exotic options. I am pricing the value of portfolio with fdm by using dupire local volatility surface calculated from fitted implied volatility surface. I have tried the following 2 methods to get the bucket vega, b...
How can I calculate bucket vega using dupire local volatility surface?
The general change of Numeraire formula gives the following Radon-Nikodym derivative: $$ \frac{dN_2(t)}{dN_1(t)}|\mathbb{F}_{t_0}=\frac{N_1(t_0)N_2(t)}{N_1(t)N_2(t_0)} $$ I am able to derive this Radon-Nikodym for specific examples, such as changing from the risk-neutral measure $Q$ to the T-Forward Measure assoc...
The general change of Numeraire formula gives the following Radon-Nikodym derivative: $$ \frac{dN_2(t)}{dN_1(t)}|\mathcal{F}_{t_0}=\frac{N_1(t_0)N_2(t)}{N_1(t)N_2(t_0)} $$ I am able to derive this Radon-Nikodym for specific examples, such as changing from the risk-neutral measure $Q$ to the T-Forward Measure asso...
The general change of Numeraire formula gives the following Radon-Nikodym derivative: $$ \frac{dN_2(t)}{dN_1(t)}|\mathcal{F}_{t_0}=\frac{N_1(t_0)N_2(t)}{N_1(t)N_2(t_0)} $$ I am able to **derive** this Radon-Nikodym for specific examples, such as changing from the risk-neutral measure $Q$ to the T-Forward Measure ...
The general change of Numeraire formula gives the following Radon-Nikodym derivative: $$ \frac{dN_2(t)}{dN_1(t)}|\mathcal{F}_{t_0}=\frac{N_1(t_0)N_2(t)}{N_1(t)N_2(t_0)} $$ I am able to **derive** this Radon-Nikodym for specific examples, such as changing from the risk-neutral measure $Q$ to the T-Forward Measure ...
The general change of Numeraire formula gives the following Radon-Nikodym derivative: $$ \frac{dN_2}{dN_1}(t)|\mathcal{F}_{t_0}=\frac{N_1(t_0)N_2(t)}{N_1(t)N_2(t_0)} $$ I am able to **derive** this Radon-Nikodym for specific examples, such as changing from the risk-neutral measure $Q$ to the T-Forward Measure ass...
The general change of Numeraire formula gives the following Radon-Nikodym derivative: $$ \frac{dN_2}{dN_1}(t)|\mathcal{F}_{t_0}=\frac{N_1(t_0)N_2(t)}{N_1(t)N_2(t_0)} $$ I am able to **derive** this Radon-Nikodym for specific examples, such as changing from the risk-neutral measure $Q$ to the T-Forward Measure ass...
I am reading a paper here: https://pdfs.semanticscholar.org/5f91/2d46b02b03230a4ffaaa42d655b2b6147d56.pdf The following is my confusion. The paper has the following continuous time model for the price of a commodity: $$\frac{dS(t)}{S(t)}=a(lnL(t)+\mu(t)-lnS(t))dt+\sigma(t)dW(t)$$ Then the paper converts this c...
Client A comes to dealer to trade variance notional $1m at T=0. The trade is executed with dealer short volatility with strike of 20. term Payoff of dealer = notional*( Stike^2 - realized vol^2 ) now at t=T1 the client , comes back with the order to reduce the notional of variance swap by half. How can the d...
How can we unwind a Index ( SPX ) Variance swap?
For the "mainstream" forex options for example those (in the size of bn) posted on this site: https://www.forexlive.com/orders/!/fx-option-expiries-for-thursday-july-02-at-the-10am-ny-cut-20200702 Do you know what type of forex options are posted in that site? Is it European option? American option? Barrier options?...
I receiving the following error when I try to compute a cap price. However, I'm not sure how to solve this error. > " error: nu (-1.00062) must be >= -1.0 expiry: June 4th, 2020 > annuity: 0.0830405 price: -1.25183e-07 atm: 0.255034 % > strike: 0.739166 % type: Call RuntimeError: could not boot...
Imagine this hypothetical situation: I have a time series of cumulative performance of a fund and two time series of equities that are highly correlated to them. I know that that this fund ONLY applies money in those two equities, since his conception. Is there a way to compute the average allocation(in %) of this f...
The general change of Numeraire formula gives the following Radon-Nikodym derivative: $$ \frac{dN_2}{dN_1}(t)|\mathcal{F}_{t_0}=\frac{N_1(t_0)N_2(t)}{N_1(t)N_2(t_0)} $$ I am able to **derive** this Radon-Nikodym for specific examples, such as changing from the risk-neutral measure $Q$ to the T-Forward Measure ass...
Note that under Risk Neutral measure, Hull White SDE for short rate is $r_{t}=X_{t}+\varphi(t)+f^{M}(0, t)$ where $X_t$ is pure [mean reverting][1] process under Risk Neutral measure: $ \mathrm{d} \mathrm{X}_{\mathrm{t}}=-\mathrm{a} \mathrm{X}_{\mathrm{t}} \mathrm{dt}+\sigma(\mathrm{t}) \mathrm{d} W_{\mathrm{t...
Note that under Risk Neutral measure, Hull White SDE for short rate is $r_{t}=X_{t}+\varphi(t)+f^{M}(0, t)$ where $X_t$ is pure [mean reverting][1] process under Risk Neutral measure: $ \mathrm{d} \mathrm{X}_{\mathrm{t}}=-\mathrm{a} \mathrm{X}_{\mathrm{t}} \mathrm{dt}+\sigma(\mathrm{t}) \mathrm{d} W_{\mathrm{t...
The Variance-Gamma (VG) process, from my inexpert point-of-view, seems to nearly perfectly model equity distributions. For longer term options, there is little to no volatility, skewness, or kurtosis parameter skew. For shorter term options, it is true as the authors claim that the VG model provides no more resol...
Why doesn't Variance-Gamma process flatten volatility skew for short term options?
Geometric Brownian motion is the most common model for asset price evolution. Is it still viable for modeling asset prices in a very short time period? For example, I have time series of length 3600 which is as asset price for each second in an hour, is GBM adequate for modeling this random process? If not, what mod...
Geometric Brownian motion is the most common model for asset price evolution. Is it still viable for modeling asset prices in a very short time period? For example, I have time series of length 3600 which is as asset price for each second in an hour, is GBM adequate for modeling this random process? If not, what mod...
I am looking to model the probability of a single issuer upgrading or downgrading it's credit rating at some time using historical data. I have done research and everything I have found so far are for multiple issuers. I am very very new to quant finance, but have a PhD background in mathematical physics so I am fami...
I'm calculating Fama-French portfolio returns for a country, to test the sign and significance of alphas for portfolios sorted by my variable of interest. I can't use Fama-French data library factors as these are not specific enough to my country. My question is that, if i'm assessing returns and alphas for 10 diffe...
Include all stocks in Fama-French portfolio calculations?
In American style exotic options, the holder is often faced with choices at certain times during the life span of the option. Following the/an optimal choice allows the user to maximize the value of the option. The price of the option, in my understanding, comes from assuming the decision that maximizes the conditional...
With exotic options, holders usually face choices at certain times. In my understanding, the price of the option is determined by assuming the optimal choice is taken and computing the discounted expectation of the payoff under the risk neutral measure with backward induction. My question is if I hold such options, how...
I was given this question on interview and couldn't find an answer in time (it is a software developer job in a place that deals with options). Can someone explain how to do this or point me to a good source of material? Given two European options --a call C and a put P -- struck at K, expiring at time T, on an und...
I provide a solution in two steps. The first steps carefully outlines how to split up the integral and what new measures are used. This first step does not require any special model assumption and holds in a very general framework. We derive a formula for your option that resembles the standard Black-Scholes formula. ...
I was given this question on interview and couldn't find an answer in time (it is a software developer job in a place that deals with options). Can someone explain how to do this or point me to a good source of material? Given two European options - a call $C$ and a put $P$ - struck at $K$, expiring at time $T$, on...
I believe, they are testing two things here: 1. That you know the Put-Call Parity (with dividends) 2. That you can successfully rearrange an equation The Put-Call Parity with continuously compounded dividends is: $$ C-P=Se^{-qT}-Ke^{-rT}$$ The second part of the question is to rearrange the above for...
I think your question can be split into two parts: (i) how to value a swap mathematically and (ii) how swaps actually work as a traded product. **Part (i)**: As noob2 pointed out, "theoretically", a swap is valued with the help of two curves: one "forward" curve and one "discounting" curve. Say you want to "value...
In Limit Order Books, orders at the same price are grouped and I call this group of orders a "price level"(I don't know if there's a name in literature). The total volume in this price level changes in time when aggressive trades occur or new orders are added to the price level. At some point in time, the TOB wil...
I am currently reading about statistical techniques to enhance the estimation of input parameters in a m.v. optimization. Specifically I have some doubts about the James-Stein estimator applied as an estimation-error correction while modeling the asset returns. Considering both [Quantitative Portfolio Optimization,...
I am currently learning about statistical techniques to enhance the estimation of input parameters in a m.v. optimization. Specifically I have some doubts about the James-Stein estimator applied as an estimation-error correction while modeling the asset returns. Considering both [Quantitative Portfolio Optimization...
I am trying to wrap my head around this statement: > dollar-neutral portfolios are built: dollar amounts of both long and short positions are equal. Furthermore, it is also true at the stock level: each position, long or short, may be normalized to one dollar. the naive 1/ N portfolio strategy, out-of-sample, is ...
Read it somewhere... What is the difference between a bond and a bond trader????? The bond matures. Here's another. What is the difference between a hedge fund and a mutual fund? Mutual funds returns more and are safer.....:)
Lets suppose we have a delta-neutral portfolio and that we want to trade the gamma. If we are long gamma, we can profit from every rebalancing to keep the portfolio delta-neutral. ### Lets suppose the following portfolio: ### + long 100 x call ATM (∆=50%, constant gamma = 10) - short 50 x stocks ($100). #...
I think your question can be split into two parts: (i) how to value a swap mathematically and (ii) how swaps actually work as a traded product. **Part (i)**: As noob2 pointed out, "theoretically", a swap is valued with the help of two curves: one "forward" curve and one "discounting" curve. Say you want to "value...
I think your question can be split into two parts: (i) how to value a swap mathematically and (ii) how swaps actually work as a traded product. **Part (i)**: As noob2 pointed out, "theoretically", a swap is valued with the help of two curves: one "forward" curve and one "discounting" curve. Say you want to "value...
Later this month the discount rate for EUR interest rate instruments changes from Eonia to EuroSTR. In October SOFR replaces EFFR. These changes will affect the value of uncleared swaptions and there has been a lot of discussion of the desirability of compensation arrangements that reverse these gains and losses as w...
Most of these companies are listed on the Eurex Exchange. https://www.eurexchange.com/exchange-en/products/equ/opt You can pull in the information for free with a 15 minute delay. Not sure if this is what you are looking for?
In the past few months, I became really interested in using machine learning techniques in the realm of quantitative finance and trading. I made a few rudimentary models and I immediately realized how difficult it is. I picked up a book "Advances in Financial Machine Learning" by Marcos Prado. It is an amazing sourc...
This might be a simple question, but I couldn't find the answer anywhere: is there a separate Volatility smile (and surface) based on Calls and a separate Volatility smile (surface) based on Puts? Or is there simply one Volatility smile (and one surface) based on the most liquid options, mixing calls and puts? I wo...
Implied Vol Smile: from Calls, Puts or Both?
I think I understand the question, but maybe not. In USD market, the most liquid IR swaps have floating leg reset quarterly from 3Mo LIBOR. (Ths will change when LIBOR is discountinued). (Market conventions differ for other currencies.) If you build your swap curve from such swap rates and ED futures (whose underlyi...
I am currently learning about statistical techniques to enhance the estimation of input parameters in a m.v. optimization. Specifically I have some doubts about the James-Stein estimator applied as an estimation-error correction while modeling the asset returns. Considering both [Quantitative Portfolio Optimization...
In practice, things are actually quite different and a bit more subtle. You really need to differentiate between the underlying being an index or e.g. a single stock. I will try to provide some insight: - Index options are, in general, of European type. The market quotes prices for calls and puts and you can back ou...
In practice, things are actually quite different and a bit more subtle. You really need to differentiate between the underlying being an index or e.g. a single stock. I will try to provide some insight: - Index options are, in general, of European type. The market quotes prices for calls and puts and you can back ou...
More or less as the title states, for which options is the industry standard to price using Monte-Carlo simulation of the underlying, and for which of those options is this the only alternative? I know rainbow options (best-of calls/puts, basket options etc.) and asian options are typical examples, do more exist?
What options are typically priced in practice by Monte-Carlo simulation?
I was told that the following two US treasury bonds diverged in yields during 2008 crisis up to 80 bps. what was the reason for it ? They are both matured in 15th Aug 2015 but has different coupon rates. 1. T 10.625% 8/15, with higher yield 2. T 4.25% 8/15
I was told that the following two US treasury bonds diverged in yields during 2008 crisis up to 80 bps. what was the reason for it ? They are both matured in 15th Aug 2015 but has different coupon rates. 1. T 10.625% 8/15, with a higher yield 2. T 4.25% 8/15
Could you possibly use the matrix flag labelling technique? The following provides some documentation and you can always design your own custom flags. I think it will be a good tool to investigate: https://mlfinlab.readthedocs.io/en/latest/labeling/labeling_matrix_flags.html
> Not specifying a correlation matrix for the Monte Carlo Simulation's random returns is equivalent to assuming no correlation or a correlation coefficient of zero, which will seriously and adversely affect the results of the simulation. In the Quasi-Random Monte Carlo Simulated Asset Allocation methodology values ar...