instruction
stringlengths
15
26.1k
Does bond market trading price has recovery assumption in mind?
I'm looking for ready-made codes (R, Python or Matlab) for calculating integrals, Fast Fourier Transform, maximum likelihood estimation and for drawing graphs like in the picture where prices are marked with a circle and a plus sign. I'm not a programmer myself so I can't write the code. Will I find them somewhere?[![e...
I was wondering how farmers use futures when they have a production ability but cannot sell what they produced ? Is the exchange not used for physically delivering products, then how does the farmer sell his prdouct?
Let's say we are working with the standard Fama-French 3 factor model and we want to add a low volatility factor. Is it alright to add a low volatility risk premium in a model such as the CAPM or FF3. Are we violating the CAPM assumption that high beta stocks are more risky and are have a higher expected return? I am w...
I'm looking for ready-made codes (R, Python or Matlab) for calculating integrals, Fast Fourier Transform, maximum likelihood estimation and for drawing graphs like in the picture where prices are marked with a circle and a plus sign. I'm not a programmer myself so I can't write the code. Will I find them somewhere? Whi...
I'm looking for ready-made codes (R, Python or Matlab) for calculating integrals, simulate trajectories of stochastic processes (like CGMY), Fast Fourier Transform, maximum likelihood estimation and for drawing graphs like in the picture where prices are marked with a circle and a plus sign. I'm not a programmer myself...
Let's say we are working with the standard Fama-French 3 factor model and we want to add a low volatility factor. Is it alright to add a low volatility risk premium in a model such as the CAPM or FF3. Are we violating the CAPM assumption that high beta stocks are more risky and have a higher expected return? I am wonde...
Can someone help me understand the intuition of the following? The formula for calculating the nominal return is: [![enter image description here][1]][1] [1]: https://i.stack.imgur.com/yUT6a.png I have the following problem for which I know the answer is A (5.4%). I was told it is because since "both eq...
Is there a good guide/mind map for factors of quantitative trading?
I have a fixed income portfolio built up in the Yieldbook and BBG Port. However due to some bad performance of my portfolio compared to the benchmark I would like to build up an optimisation which maximise a score such as the ratio (or not necessarily a ratio) between YTM and risk where risk is a function of duration,...
`Ito's lemma` is used to find the `stochastic process` of the function of a `Geometric Brownian process`. My question, is there any limitation of the kind of function that can be considered for correctly using the `Ito's lemma`, apart from just being continuous everywhere within the domain of the function? Any in...
Assuming a variable $v$ follows some `GBM` as below - $dv=\mu v dt + \sigma v dW_t, v \in \left( -\infty, \infty \right) $ I want to get the process of $|v|$ How can I use the `ito's lemma` in this context given that the function $|v|$ is not smooth?
Assuming a variable $v$ follows some `Stochastic Process` as below - $dv=\mu v dt + \sigma v dW_t, v \in \left( -\infty, \infty \right) $ I want to get the process of $|v|$ How can I use the `ito's lemma` in this context given that the function $|v|$ is not smooth?
I was wondering if there is an efficient way to extract data on all the stocks from the CRSP dataset? In the Query Form I only have the option to enter company codes individually or to upload a .txt file with one company code per line. Both of which is not an efficient option. Is there a way to possibly achieve thi...
How to download all stocks from NYSE, AMEX and Nasdaq from CRSP without entering individual company codes?
I have a question regarding the calculation of the lot size for cfd and forex instruments when we have a risk amount as a percentage of the balance. So how to compute the lot size to trade knowing the stop loss value and the entry point value for a buy trade in order to match the risk amount when the stop loss is re...
We use Algorithmics RiskWath where portfolios are analyzed by VAR over scenarios. Can I say that they are predictions' reports? or description's report?
Can i said VAR is a prediction report?
We use Algorithmics RiskWatch where portfolios are analyzed by VaR over scenarios. Can I say that they are predictions reports? or descriptions reports?
Can I say VAR is a prediction report?
Assuming I have a stochastic volatility model for an asset, if I wanted to use it for pricing I would proceed in the following way: 1) Use Euler discretization to simulate a sample path of the price and volatility 2) Select a range of maturities and strikes and, knowing the sample path of the asset price, retrieve ...
I would like to make a simple backtest for one of my short-selling strategies. I am using pandas dataframes. So I have a dataframe like the following, that indicates how many positions to open/close every day. position_change position_total 2018-01-03 1 1 2018-01-04 0 ...
I am wondering if there is any difference between 2 terms call `model backtesting` and `model validation` from the perspective of `financial risk models` like `VaR`. Could someone share some insight on similarity and dissimilarity of these 2 terms?
In my opinion model validation is broader than model backtesting. During model backtesting you test model performance on data that has been realised. This gives you an idea on model accuracy and it allows you to find out where the model or submodels are inaccurate or misleading. Model validation can include backtest...
In my opinion model validation is broader than model backtesting. During model backtesting you test model performance on data that has been realised using only the data you could have used when using the model for risk management. This gives you an idea on model accuracy and it allows you to find out where the model or...
Arbitrage Pricing Theory makes the implication that statistical factors (i.e. those that explain covariances) imply pricing factors (i.e. those that explain returns). Is the reverse implication (i.e. pricing factor --> statistical factor) also true? If not, what are some common pricing factors that do not explain co...
I would like to make a simple backtest for one of my short-selling strategies. I am using pandas dataframes. So I have a dataframe like the following, that indicates how many positions to open/close every day. position_change position_total 2018-01-03 1 1 2018-01-04 0 ...
**Summary**: long-story cut short, the question is asking for what types of functions $f(.)$, the Cameron-Martin-Girsanov theorem can be used as follows: $$ \mathbb{E}^{\mathbb{P}^2}[f(W_t)]=\mathbb{E}^{\mathbb{P}^1}\left[\frac{d\mathbb{P}^2}{d\mathbb{P}^1}f(W_t)\right] $$ **Long story**: the Radon-Nikodym when ...
**Summary**: long-story cut short, the question is asking for what types of functions $f(.)$, the Cameron-Martin-Girsanov theorem can be used as follows: $$ \mathbb{E}^{\mathbb{P}^2}[f(W_t)]=\mathbb{E}^{\mathbb{P}^1}\left[\frac{d\mathbb{P}^2}{d\mathbb{P}^1}f(W_t)\right] $$ **Long story**: the Radon-Nikodym when ...
**Summary**: long-story cut short, the question is asking for what types of functions $f(.)$, the Cameron-Martin-Girsanov theorem can be used as follows: $$ \mathbb{E}^{\mathbb{P}^2}[f(W_t)]=\mathbb{E}^{\mathbb{P}^1}\left[\frac{d\mathbb{P}^2}{d\mathbb{P}^1}f(W_t)\right] $$ **Long story**: the Radon-Nikodym when ...
I want to estimate/predict the volatility of the currency exchange rate. I have checked in literature a few models from very simple PPP to econometric factor model forecasting, to DCC (dynamic conditional correlation). Are there more suitable models? if yes may you mention them and indicate some references? Currently ...
I want to estimate/predict the volatility of the currency exchange rate. I have checked in literature a few models from very simple PPP to econometric factor model forecasting, to GARCH (for univariate), to DCC (dynamic conditional correlation for multivariate). Are there more suitable models? if yes may you mention t...
how can we use auto correlation plot or correlogram to interpret time series data? I have 6 different acf plots (a,b,c,d,e,f), from this 6 plots what kind of informations and patterns can I identify? [![enter image description here][1]][1] plot **b** is a straight line because all the values in the series are th...
How to use autocorrelation plot to interpret time series data?
I am kinda new to time-series analysis, I want model CEE (EUR/HUF, EUR/PLN, EUR/CZK, EUR/CHF) exchange rates with ARIMA. I understand that according to Box-Jenkins modeling, I should first check if my dataset is stationary. I ran the ADF, and KPSS test, for the exchange rates and I got the results that with a drift ter...
I am kinda new to time-series analysis, I want model CEE (EUR/HUF, EUR/PLN, EUR/CZK, EUR/CHF) exchange rates with ARIMA. I understand that according to Box-Jenkins modeling, I should first check if my dataset is stationary. I ran the ADF, and KPSS test, for the exchange rates and I got the results that with a **drift t...
I've been learning about Linear Diffusions and how their infinitesimal generators can be used to relate expectations and deterministic differential equations. Let $X$ be an one-dimensional diffusion with the following dynamics: $dX_t = \mu(X_t)dt + \sigma(X_t)dW_t$ Its infinitesimal generator $\mathcal{G}$...
KeSchn and I pointed out in the comments that this it is not possible to represent all stock dynamics using the Generalized Black Scholes model. For example, there can be jumps at random moments and not just at random moments but also of jumps random size. These jumps can affect either $\mu_t$ or $\sigma_t$. Models wit...
Assuming your dataframe looks something like this and the name of the dataframe is `your_dataframe` (I left out one of your columns that wasn't needed for this): position pos_total price ss_change 0 1 1 10.0 1.000000 1 0 1 9.0 1.111111 2 0 ...
Whats the difference between Order Expire and Order Done for Day (DFD) ? In general and from FIX protocol point of view.
KeSchn and I pointed out in the comments that this it is not possible to represent all stock dynamics using the Generalized Black Scholes model. For example, there can be jumps at random moments and not just at random moments but also jumps of random size. These jumps can affect either $\mu_t$ or $\sigma_t$. Models wit...
To discover trading prices of high volatility, I measure the standard deviation of two currency pairs using a simple example: prices_currency_1 = [1, 100] prices_currency_2 = [.1, 10] The standard deviation of `[1, 100]` is 49.5, Python code: np.array([1, 100]).std() Transforming prices_curr...
In the Schöbel-Zhu model, the stochastic volatility process is $dv_t=\kappa(\theta-v_t)dt+\sigma dW_t$. The characteristic function of the stock process can be found by arguing that the model is affine if we expand the set of variables to include $v^2_t$. The argument is that applying Ito's lemma we find $dv^2_t...
Why is the Schöbel-Zhu model affine?
Don't worry I understand mathematics: ito's calc, martingales, etc. I am just curious what options I should test, and from what indices. Is there stuff I can test from the 2008 crash to measure their effects, or from COVID-19. Or data preloaded into Matlab. What type of options would be best to model their behavior?
Don't worry I understand mathematics: ito's calc, martingales, etc. I am just curious what options I should test, and from what indices. Is there stuff I can test from the 2008 crash to measure their effects, or from COVID-19. Or data preloaded into Matlab. What type of options would be best to model their behavior usi...
# Delivery Not Necessary # Delivery is not necessary for futures to provide a price hedge. Most futures are specified so that they settle to a cash price at expiry. If a contract is not physically-settled, then any trader in the physical good could make easy money if the futures traded far from the cash settle. # N...
I found some great posts on power options, for example https://quant.stackexchange.com/questions/49507/finding-price-of-the-power-option. Whilst the maths is clear, I am still somewhat confused about the concept: coming more from the rates background, I have never considered power options until recently and do not full...
I am trying to model the pricing of an asset called "Turbo warrants", which to me look a lot like a Down-and-out Barrier options with leverage. When the price of the underlying asset hits a certain barrier (B), the contract becomes worthless. The issuer of these Turbo warrants indicates that their price is calculated a...
Can "Turbo warrants" be priced using the Black & Scholes model?
I found some great posts on power options, for example https://quant.stackexchange.com/questions/49507/finding-price-of-the-power-option. Whilst the maths is clear, I am still somewhat confused about the concept: coming more from the rates background, I have never considered power options until recently and do not full...
I am trying to model the pricing of an asset called "Turbo warrants", which to me look a lot like a Down-and-out Barrier options with leverage. When the price of the underlying asset hits a certain barrier (B), the contract becomes worthless. The issuer of these Turbo warrants indicates that their price is calculated a...
I am trying to model the pricing of an asset called a "Turbo warrant", which to me looks a lot like a Down-and-Out Barrier option with leverage. When the price of the underlying asset hits a certain barrier (B), the contract becomes worthless. The issuer of these Turbo warrants indicates that their price is calculated ...
I am trying to model the pricing of an asset called a "Turbo warrant", which to me looks a lot like a Down-and-Out Barrier option with leverage. When the price of the underlying asset hits a certain barrier (B), the contract becomes worthless. The issuer of these Turbo warrants indicates that their price is calculated ...
I am trying to model the pricing of an asset called a "Turbo warrant", which to me looks a lot like a Down-and-Out Barrier option with leverage. When the price of the underlying asset hits a certain barrier (B), the contract becomes worthless. The issuer of these Turbo warrants indicates that their price is calculated ...
I am trying to model the pricing of an asset called a "Turbo warrant", which to me looks a lot like a Down-and-Out Barrier option with leverage. When the price of the underlying asset hits a certain barrier (B), the contract becomes worthless. The issuer of these Turbo warrants indicates that their price is calculated ...
When one construct surface for Implied volatilities using `Heston model` from different Strike prices and Maturities, we get a surface where long dated volatilities are smaller than the short dated ones. Is there any business reason for such shape?
When calculating the $M$ in: $$ F' = C^{−1}[M−R] $$ where $M$ is a matrix of $n$ securities returns, is the log return or arithmetic return intended to be used? In section [8.2 of Thorps THE KELLY CRITERION IN BLACKJACK SPORTS BETTING,AND THE STOCK MARKET][1]) table 7 shows mean log returns. Further down Thorp n...
Does any corporate event that affects the stock price/shares outstanding happen during the trading session in vanilla US Common stocks or predominantly at night ?
Do corporate events happen intraday?
When calculating the $M$ in: $$ F^* = C^{−1}[M−R] $$ (see Page 34 Row 38 in the paper cited below) where $M$ is a matrix of $n$ securities returns, is the *log return* or *arithmetic return* intended to be used? In section [8.2 of Thorps THE KELLY CRITERION IN BLACKJACK SPORTS BETTING,AND THE STOCK MARKET][1]) t...
In: $F* = C^{−1}[M−R]$ where $M$ is a vector of $n$ securities returns, is the log return, or arithmetic return, intended to be used for computing the drift rate $M$? [Thorp writes (8.4)][1]: > Consider first the unconstrained case with a riskless security (T-bills) with portfolio fraction $f0$ and $n$ securities ...
In: $F* = C^{−1}[M−R]$ where $M$ is a vector of $n$ securities returns, is the log return, or arithmetic return, intended to be used for computing the drift rate $M$? [Thorp writes (8.4)][1] (see Page 34 row 18): > Consider first the unconstrained case with a riskless security (T-bills) with portfolio fraction $f0...
I am looking for a place to get all NYSE/NASDAQ data for every trade(price/size) on a particular ticker. The data can be delayed by minutes/hours. I am a student and am trying to use this for a project, so I am on a limited budget. So far I know of TradingPhysics offers \$0.20 per stock per day, and IQfeed would be aro...
Let $$\ln\left(S_T/S_t\right) $$ have mean $\mu_\tau$ and standard deviation $\sigma_\tau$, where $\tau=T-t$, and density of its standardized form $$ X= \frac{\ln(S_T/S_t)-\mu_\tau}{\sigma_\tau} $$ approximated by Gram-Charlier expansion $$ f_X(x) = \phi(x) - \gamma_{1\tau} \frac{1}{3!} D^3 \phi(x) + \gamm...
Let $$\ln\left(S_T/S_t\right) $$ have mean $\mu_\tau$ and standard deviation $\sigma_\tau$, where $\tau=T-t$, and density of its standardized form $$ X= \frac{\ln(S_T/S_t)-\mu_\tau}{\sigma_\tau} $$ approximated by Gram-Charlier expansion $$ f_X(x) = \phi(x) - \gamma_{1\tau} \frac{1}{3!} D^3 \phi(x) + \gamm...
I found some great posts on power options, for example https://quant.stackexchange.com/questions/49507/finding-price-of-the-power-option. Whilst the maths is clear, I am still somewhat confused about the concept: coming more from the rates background, I have never considered power options until recently and do not full...
I found some great posts on power options, for example https://quant.stackexchange.com/questions/49507/finding-price-of-the-power-option. Whilst the maths is clear, I am still somewhat confused about the concept: coming more from the rates background, I have never considered power options until recently and do not full...
I found some great posts on power options, for example https://quant.stackexchange.com/questions/49507/finding-price-of-the-power-option. Whilst the maths is clear, I am still somewhat confused about the concept: starting with a simple option on Stock price squared, I do not fully comprehend how an optional claim can b...
I found some great posts on power options, for example https://quant.stackexchange.com/questions/49507/finding-price-of-the-power-option. Whilst the maths is clear, I am still somewhat confused about the concept: starting with a simple option on Stock price squared, I do not fully comprehend how an optional claim can b...
I found some great posts on power options, for example https://quant.stackexchange.com/questions/49507/finding-price-of-the-power-option. Whilst the maths is clear, I am still somewhat confused about the concept: starting with a simple option on Stock price squared, I do not fully comprehend how an optional claim can b...
**Short story**: the process for Stock price squared is not a martingale when discounted by the money-market numeraire under the risk-neutral measure. How can we then compute derivative prices on $S_t^2$ under the risk neutral measure? Wouldn't this lead to arbitrage? **Long story**: I found some great posts on powe...
I was looking at the various examples provided in the discussion https://quant.stackexchange.com/questions/14102/worked-examples-of-applying-itos-lemma **One such example is 9.1 (c). This states that -** if $S_t =\! S_0 + \int\limits_{0}^{t} \mu_u S_u du + \int\limits_{0}^{t} \sigma_u S_u dW_u$ with $\mu=\left(\m...
Have you thought about mirroring the data? So you would have in the missing data period the replication of what happened during the day, but in an inverse way.
My Question In: $F^* = C^{−1}[M−R]$ where $M$ is a vector of $n$ securities returns, is the log return, or arithmetic return, intended to be used for computing the drift rate $M$? Background [Thorp writes (8.4)][1] (see Page 34 row 18): > Consider first the unconstrained case with a riskless security (T-bill...
The [Black-Scholes price of a European call option][1] is given by $$ C_0^{BS}(T, K) = \mathbb{E}_Q[e^{-rT}(S_T - K)_+] = S_0 \Phi(d_1) - Ke^{-rT}\Phi(d_2) ,$$ where $$ d_{1,2} = \frac{\log\big(\frac{S_0}{K}\big) + (r\pm \frac{1}{2}\sigma^2)T}{\sigma \sqrt{T}}, $$ and the underlier $S_t$ has the following dy...
The [Black-Scholes price of a European call option][1] is given by $$ C_0^{BS}(T, K) = \mathbb{E}_Q[e^{-rT}(S_T - K)_+] = S_0 \Phi(d_1) - Ke^{-rT}\Phi(d_2) ,$$ where $$ d_{1,2} = \frac{\log\big(\frac{S_0}{K}\big) + (r\pm \frac{1}{2}\sigma^2)T}{\sigma \sqrt{T}}, $$ and the underlier $S_t$ has the following dy...
Why do we use copulas for spread options but do not use them to correlate random variables across time, such as in the forward starting option?
Why do we not use copula for forward starting options?
I'm puzzled about certain parameters in calculating the annualized Sharpe Ratio using monthly return data. 1. Average excess return: Does this mean the arithmetic average of all the monthly excess returns? Or should I calculate the rate of monthly return that, if compounded, will result in the overall excess return...
The [Black-Scholes price of a European call option][1] is given by $$ C_0^{BS}(T, K) = \mathbb{E}_Q[e^{-rT}(S_T - K)_+] = S_0 \Phi(d_1) - Ke^{-rT}\Phi(d_2) ,$$ where $$ d_{1,2} = \frac{\log\big(\frac{S_0}{K}\big) + (r\pm \frac{1}{2}\sigma^2)T}{\sigma \sqrt{T}}, $$ and the underlier $S_t$ has the following dy...
The [Black-Scholes price of a European call option][1] is given by $$ C_0^{BS}(T, K) = \mathbb{E}_Q[e^{-rT}(S_T - K)_+] = S_0 \Phi(d_1) - Ke^{-rT}\Phi(d_2) ,$$ where $$ d_{1,2} = \frac{\log\big(\frac{S_0}{K}\big) + (r\pm \frac{1}{2}\sigma^2)T}{\sigma \sqrt{T}}, $$ and the underlier $S_t$ has the following dy...
**Short story**: the process for Stock price squared is not a martingale when discounted by the money-market numeraire under the risk-neutral measure. How can we then compute derivative prices on $S_t^2$ under the risk neutral measure? Wouldn't this lead to arbitrage? **Long story**: I found some great posts on powe...
This is definitely not generally true `HestonModel`'s behaviour is controlled by several parameters, but looking at the equation for variance in the Heston model we see that the long term vol is determined by the $\theta$ term, variance will tend to equal this because if it goes above the drift pulls it back down, a...
If i understand this correctly, you want to be able to infer a future volatility surface, given the current simulation parameters you have. What you're essentially trying to do it include the modelling of forward vol/skew in your MC. Getting the forward vol surface vaguely correct is quite important to price some...
**Short story**: the process for Stock price squared is not a martingale when discounted by the money-market numeraire under the risk-neutral measure. How can we then compute derivative prices on $S_t^2$ under the risk neutral measure? Wouldn't this lead to arbitrage? **Long story**: I found some great posts on powe...
**Short story**: the process for Stock price squared is not a martingale when discounted by the money-market numeraire under the risk-neutral measure. How can we then compute derivative prices on $S_t^2$ under the risk neutral measure? Wouldn't this lead to arbitrage? **Long story**: I found some great posts on powe...
After running an optimisation using a quadratic utility (CRRA) function I calculate an CVAR that is equal to the VAR especially for very small risk-aversion levels (y=1 and y=2 e.g.). What is the intuition behind this finding? I would think that the skewness and kurtosis are aproximately normal and these approach one a...
I have a portofolio with 30 indexes and I want to calculate the annulised returns and volatility because I want to compare it with another portofolio with different number of indexes (but same time period) My data are time series with 3 month frequency from 2009-12-31 to 2020-3-31. I know that the general formula i...
I am looking for a place to get all NYSE/NASDAQ data for every trade (price/size) on a particular ticker. The data can be delayed by minutes/hours. I am a student and am trying to use this for a project, so I am on a limited budget. So far I know of TradingPhysics offers \$0.20 per stock per day, and IQfeed would be ar...
After running an optimisation using a quadratic utility (CRRA) function I calculate an CVAR that is equal to the VAR especially for very small risk-aversion levels ($\gamma$=1 and $\gamma$=2 e.g.). What is the intuition behind this finding? I would think that the skewness and kurtosis are approximately normal and these...
Consider a financial market with a filtered probability space $\left(\Omega,\mathcal{F},(\mathcal{F}_t),\mathbb P\right)$ satisfying usual conditions equipped with a stock price process $S_t$. Suppose there exists a risk-free asset who is governed by $\mathrm{d}B_t=r_tB_t\mathrm{d}t$. Suppose the market is free of a...
Let's say we wish to value a company using the DCF method. To determine which discount rate to use for the cash flows we choose to use the CAPM methodology. The estimated beta of the company can tell us how its price today relates to the expected value of its price in the next period. I am having trouble seeing why thi...
After I went through the derivation to get the skew in [Backus et al.][1], I had two questions: 1. In the proof, it mentioned the application of the arbitrage condition and then obtained equation (31): $$\mu_n = (r_{nt} - r^*_{nt})n - \sigma_n^2 /2 - \sigma_n^3\gamma_{1n}/3! -\sigma_n^4\gamma_{2n}/4!,$$ I don't ...
For DCF valuation, there is a simple rule: the type of cashflow dictates the type of discount rate to use. Dividends are discounted at the CAPM rate (although one can also use other equity factor models). Free cash flow to the firm is discounted using the WACC; and, free cash flow to equity is discounted using the CAPM...
# Discount Rate Matches the Cashflow Type # For DCF valuation, there is a simple rule: the type of cashflow dictates the type of discount rate to use. Dividends are discounted at the CAPM rate (although one can also use other equity factor models). Free cash flow to the firm is discounted using the WACC; and, free cas...
I am trying to work out a formula to derive the expected loss from the credit risk of a bond. My idea is to tie the credit risk to credit valuation adjustment and derive the expected loss from there, but then how would I relate credit risk and credit valuation adjustment? Help would be greatly appreciated. T...
How to derive the expected loss from the credit risk of a bond?
Consider a financial market with a filtered probability space $\left(\Omega,\mathcal{F},(\mathcal{F}_t),\mathbb P\right)$ satisfying usual conditions equipped with a stock price process $S_t$. Suppose there exists a risk-free asset who is governed by $\mathrm{d}B_t=r_tB_t\mathrm{d}t$. Suppose the market is free of a...
Empirical studies have shown that market impact can be linked to the following parameters: $$ \mathcal{I}(Q) = \kappa \ . \ \sigma \ . \ (\frac{Q}{V})^\gamma + \alpha \ . \ \psi_{BA} $$ where $\psi_{BA}$ is the bid-ask spread. Can anyone explain the linear relationship in the sp...