instruction
stringlengths
15
26.1k
How to calculate a Corporate Bond Transaction Price (Bond returns?)?
I recently started working myself into the concepts of valuation. While I find the concept of fair value very interesting and intuitive, I wonder if prices are actually empirically driven by value in the long run. For convenience, let me summarize my understanding of the concept (please correct me at any point if I...
Do stock prices really tend towards a fair valuation?
> The Markowitz problem is an optimization problem of a series of > Gaussian distributions (symmetric) with a variance-covariance matrix This is a common misunderstanding. Markowitz (*mean-variance* = MV) model do not require the Normal distribution of returns, even if such condition is optimal in some sense. The o...
Unlike price data which is ingested as a bundle, fundamental data in Zipline is usually used via Pipeline and thus requires writing a custom `PipelineLoader` that knows how to load the particular fundamental dataset you're using. I'm not aware of much documentation for writing a custom `PipelineLoader` apart from [digg...
*"How should I define the transaction price of a bond? and how to calculate it?"* "The Trade Reporting and Compliance Engine is the FINRA-developed vehicle that facilitates the mandatory **reporting of over-the-counter transactions in eligible fixed income securities**" (my emphasis) - https://www.finra.org/filing-...
Doesn't the intrinsic value rise 1:1 with stock price when an American option is in the money? Also, you can exercise the option at any time to capture the intrinsic value (even though this would be throwing away the extrinsic value).
Why isn't the delta of a slightly in the money American option 1?
I have been looking at a few forex platform and they provide high leverage with overnigh fees close to LIBOR. The same is not true for shares on stocks and they provide 5x leverage with higher interest rates. Why is this?
The prices of most coupon-paying bonds (not only corporates, but treasuries, munis, etc) are quoted "clean" (without the accrued coupon) rather than "dirty" (with the accrued coupon). If you agree to buy a bond for a (clean) price $P$, then on the settlement date (generally 1-3 business days after your trade date, d...
Take a look at Amazon stock. What do you think happened there? why did price move up? what happened here is that market expectation of future cashflows kept on getting better which was manifested in stock price rising. There is no way for you to know what was market expectation of cashflow really.. observable metric is...
Discounted cashflow is a framework. For a stable company with years of track record and predictable cash flows, it should give you a framework to conduct your analysis and form some opinion (or revise them). As you may have realized, it is extremely hard to predict cashflows and these predictions can depend on extraneo...
Assuming the 92-day and 274 day interest rate is 8% (act/360, money market yield) compute the 182- day forward rate starting in 92 days (act/360, money market yield). 1)7.80% 2)8.00% 3)8.20% 4)8.40% Answer provided is 7.20%. I don't understand this question. How is this computation made? To answer t...
Assuming the 92-day and 274 day interest rate is 8% (act/360, money market yield) compute the 182- day forward rate starting in 92 days (act/360, money market yield). 1)7.80% 2)8.00% 3)8.20% 4)8.40% Answer provided is 7.20%. I don't understand the term act/360 given in this question. What is its mea...
Assuming the 92-day and 274 day interest rate is 8% (act/360, money market yield) compute the 182- day forward rate starting in 92 days (act/360, money market yield). 1)7.80% 2)8.00% 3)8.20% 4)8.40% Answer provided is 7.20%. I don't understand the term act/360 given in this question. What is its mea...
Suppose a small quant group (4 guys) and the tick data is in hand, shall they persist the historical daily/weekly or even smaller scale like hourly/minutes bars data, or just do the on-demand resampling from existing data (minutes from tick, and then resampling to hour/day by minutes)? Could you please advice based on...
Suppose a stock is currently at 100. If there are more willing buyers of a stock (retail investors, institutionals etc.) at $110 than sellers (also retail investors, institutionals etc.), you would expect the stock to gravitate towards the price at which there is a balance between the buyers and sellers of that stock. ...
What are the mechanisms at play determining option pricing on stocks?
Assuming the 92-day and 274 day interest rate is 8% (act/360, money market yield) compute the 182- day forward rate starting in 92 days (act/360, money market yield). 1)7.80% 2)8.00% 3)8.20% 4)8.40% Answer provided is 7.20%. I don't understand the term act/360 given in this question. What is its mea...
I have a stochastic process to model the stochastic discount factor (SDF) with M: \begin{equation} dM_t = aM_tdt + bM_t d Z_t \end{equation} where, $Z_t$ is a standard brownian motion. How do I show that $a = -r$, where $r$ is the continuously compounded risk-free rate? I think that I should use the following equ...
I am trying to use the QuantLib library with Python. In the example below, I create a pandas dataframe with some dates and some cashflows, convert the dates from pandas' format to QuantLib's, and use QuantLib to calculate the daycount (which is banal for act/365, but QuantLib comes in handy for other cases like 30/3...
Converting pandas datetime to QuantLib dates: why do the inputs need to be converted to int only some times? It seems random
What data vendors/providers have you come across or used for alternative datasets? Not talking about market data here. Things like rainfall, coronavirus stats, new car production in China etc. I
I have a stochastic process to model the stochastic discount factor (SDF) with M: \begin{equation} dM_t = aM_tdt + bM_t d Z_t \end{equation} where, $Z_t$ is a standard brownian motion. How do I show that $a = -r$, where $r$ is the continuously compounded risk-free rate? I think that I should use the following equ...
I recently started working myself into the concepts of valuation. While I find the concept of fair value very interesting and intuitive, I wonder if prices are actually empirically driven by value in the long run. For convenience, let me summarize my understanding of the concept (please correct me at any point if I...
I will have an interview for a junior position as interest rates volatility trader. I would like ask you some questions about greeks of caps floors and swaptions. Are Caps vega positive? Are floors and swaptions too? A spread volatilty trading usiing caps/floors differs from a trade using swaptions from the rate...
One of the tasks in the book we´re using in introduction to finance is >Stocks are expected to earn (much) more than the risk-free interest rate. This means that stock prices are expected to increase over time which, in turn, means that stock prices will be positively autocorrelated and that they are not a fair gam...
The geometric mean of quantities $\{a_1, \dots, a_n\}$ is $$ \bar{a}_g = \left( \prod_{i=1}^n a_i \right)^{1/n} $$ Taking the logarithm of both sides gives $$ \log \bar{a}_g = \frac{1}{n} \sum_{i=1}^n \log a_i $$ so the log of the geometric mean is equal to the arithmetic mean of the logs. In your case, the ...
I have 3 related questions: **a) I've seen formulas for GM and GS which eithier do, or do not, involve taking the exponent. Which is right?** i.e. for GM I've seen both $\text{mean}(\ln(1+r_{t}))$ and $\exp(\text{mean}(\ln(1+r_{t})))-1$ For GS again I've seen both $\text{std}(\ln(1+r_{t}))$ and $\exp(\text{std...
I am trying to learn QuantLib for Python but I must say I am banging my head against the documentation (I also bought Ballabio's python cookbook) - maybe it's me, but even finding the most basic concepts seems a struggle. **How can I do something as banal as discounting a set of irregular cashflows?** The cashflows ...
QuantLib Python: how to calculate the npv of irregular cashflows?
I am currently modelling financial time series via ARMA processes, but I have reason to believe that in addition to significant autocorrelation, the time series also exhibit skewness. Is there a way to estimate them jointly? I am aware of [Simulation of Non-normal Autocorrelated Variables][1], but it only talks abou...
I am trying to learn QuantLib for Python. Further to my [previous question][1] on the syntax for CashFlows.npv(), now that I understand how the syntax works, I have a question on why the output differs from what I'd expect (which is why I think a separate question is justified). In my toy example, my cashflows are z...
QuantLib Python: why is the NPV different? NPV(0.1,[0,110]) should be 100, not 99.53
I am currently implementing the MatLab code reported below for the calibration of Heston Model. The code seems fine and, by reading the paper where I took the code, I was able to calibrate and price obtaining exactly the same results as the paper. Then I have tried to use the same code for call options on SP500 but...
A while ago exchange-traded option symbols migrated to a 21-character descriptor, formalized by the Options Clearing Corporation (OCC), consisting of: * 7 characters: root or underlying symbol * 6 characters: expiration date formatted YYMMDD * 1 character : option type, C (call) or P (put) * 8 characters: strike ...
I'd be really interested to hear people's experiences of implementing global solvers for curve construction, especially with regard to how robust the approach is in practice, numerical performance, stability of the resulting Greeks and Jacobian. The topic is well laid out [here][1], with some good examples. I'm interes...
I have 2 questions: If I want to discount a set of irregular cashflows, I can do it using the SimpleCashFlow class, or defining a bond with custom cashflows (thank you to Ballabio and David Duarte for their previous clarifications on this. I have copied a toy example below. 1) However, **can I calculate duration...
QuantLib Python: how to calculate duration and convexity for irregular cashflows? Can I use SimpleCashFlow or must I define a custom bond?
I have 2 questions: If I want to discount a set of irregular cashflows, I can do it using the SimpleCashFlow class, or defining a bond with custom cashflows (thank you to Ballabio and David Duarte for their previous clarifications on this. I have copied a toy example below. 1) However, **can I calculate duration...
What are the commonly used methods to compare the cost of volga/vanna in credit index options across time and strikes? In practice, is the Vanna-Volga exposure technique used in credit, or are there nuances which make it unsuitable? TLDR: the end-goal is to be able to assess the richness or cheapness of skew, volga...
Cost of Volga & Vanna in Credit Options?
I think that you almost had both. You were just missing the combination of an `InterestRate` and the `includeSettlementDateFlows` boolean flag. The following works: ```lang-py import QuantLib as Ql import logging ql = Ql # Set up logging numeric_level = getattr(logging, 'INFO', None) logging.basicConfig(leve...
I think that you almost had both. You were just missing the combination of an `InterestRate` and the `includeSettlementDateFlows` boolean flag. The following works: ```lang-py import QuantLib as Ql import logging ql = Ql # Set up logging numeric_level = getattr(logging, 'INFO', None) logging.basicConfig(leve...
I am currently implementing the MatLab code reported below for the calibration of Heston Model. The code seems fine and, by reading the paper where I took the code, I was able to calibrate and price obtaining exactly the same results as the paper. Then I have tried to use the same code for call options on SP500 but...
In practice, when bilateral counterparties switch from OIS to ESTR discounting, the party which sees a fall in the fair value of the CSA contract gets compensated for the decrease by the other party (correct me if I'm wrong). As CSA discounting (ESTR) is used and ESTR is payed for collateral received (PAI), we are also...
In the option pricing framework, one starts with a model for the underlying stock. In the Black-Scholes model, the stock price follows a geometric Brownian motion $$dS(t)=S(t)(\mu dt+\sigma dW(t))$$ where $\mu$ and $\sigma$ are two input parameters. From here, we can derive the price of, for example, a call option, a...
I have 2 questions: If I want to discount a set of irregular cashflows, I can do it using the SimpleCashFlow class, or defining a bond with custom cashflows (thank you to Ballabio and David Duarte for their previous clarifications on this. I have copied a toy example below. 1) However, **can I calculate duration...
I think that you almost had both. You were just missing the combination of an `InterestRate` and the `includeSettlementDateFlows` boolean flag. The following works: ```lang-py import QuantLib as Ql import logging ql = Ql # Set up logging numeric_level = getattr(logging, 'INFO', None) logging.basicConfig(leve...
Can anyone suggest resources for option pricing using GARCH models? Although I have a fairly good knowledge of GARCH models, for some reason I cannot seem to be able to follow Duan's paper and how to replicate it with R. Other papers look even more advance, but first I try to understand how GARCH model is fitted to opt...
I am trying to calibrate Heston model on some data and I have the following code. Code is supposed, after it reads the data, to give back 5 parameters. However, I get an empty answer from MatLab. Does somebody know what's wrong with this code? Thanks in advance. ``` function call = HestonCallQuadl(kappa,theta,sigma...
I want to prove why there is no Arbitrage opportunities when Long Butterfly >0.I know there is a similar topic out there but seems it doesn't solve my question (https://quant.stackexchange.com/questions/32607/prove-that-the-butterfly-condition-is-always-greater-than-zero/32609). By call-put parity, I know C(T,K+∆K...
How to prove Long Butterfly >0 has no Arbitrage opportunities?
I want to prove why there is no Arbitrage opportunities when Long Butterfly >0.I know there is a similar topic out there but seems it doesn't solve my question (https://quant.stackexchange.com/questions/32607/prove-that-the-butterfly-condition-is-always-greater-than-zero/32609). By call-put parity, I know > C(...
My problem is that I have a surface of implied black volatilites that is supposed to represent market data. However, the surface contains some slight arbitrage. More precisely, the graph contains butterfly arbitrage for some strikes due to non-convexity of the discrete graph of call-option values. This arbitrage, o...
I want to prove why there are no arbitrage opportunities when a long butterfly is strictly positive. I know there is a similar topic out there, but it seems it doesn't solve my question: https://quant.stackexchange.com/questions/32607/prove-that-the-butterfly-condition-is-always-greater-than-zero/32609. By call-put...
How to prove no-arbitrage when a long butterfly is strictly positive?
I want to prove why there are no arbitrage opportunities when a long butterfly is strictly positive. I know there is a similar topic out there, but it seems it doesn't solve my question: https://quant.stackexchange.com/questions/32607/prove-that-the-butterfly-condition-is-always-greater-than-zero/32609. By call-put...
It sounds like you haven't filtered away static arbitrage strategies (such as butterfly spreads, call spreads and calendar spreads) from your data. To keep my answer short and concise, there's a paper by [Carr & Madan (2005)](https://www.sciencedirect.com/science/article/pii/S1544612305000413?casa_token=e1_qqXFgv2AAAAA...
I am trying to do some time series analysis on the margin resulting from three specific commodity futures contracts and ultimately forecast the margin. The margin is calculated as M = F1 + F2 - F3. I have the daily close prices for F1, F2, and F3, with the associated date and margin calculation. The point I would li...
How do I deal with nonexistant data in a time series with an irregular frequency?
I want to prove why there are no arbitrage opportunities when a long butterfly is strictly positive. I know there is a similar topic out there, but it seems it doesn't solve my question: https://quant.stackexchange.com/questions/32607/prove-that-the-butterfly-condition-is-always-greater-than-zero/32609. By call-put...
I want to show that $$\int_0^T(T-t)dW_t=\int_0^TW_t \ dt \tag1$$ By Ito's lemma we can write $$d((T-t)W_t)=(T-t)dW_t-W_t \ dt.\tag{2}$$ Now If I integrate this expression and use that $W_0=0$ I should be able to show that the integrals in $(1)$ are equivalent according to [Wikipedia][1]. Am I supposed to integrat...
Here is a brief excerpt on the fixed income chapter from the 2020-2021 level 1 CFA curriculum: > 4. Generally, for the same coupon rate, a longer-term bond has a greater > percentage price change than a shorter-term bond when their market > discount rates change by the same amount (the maturity effect). > >[...]...
How can a deep discount bond with a longer time to maturity have a LOWER duration than an otherwise identical bond with a shorter time to maturity?
Market participants are usually assumed to be risk-averse and striving to improve the Sharpe ratios of their portfolios. Thus, if we have an asset A, which is expected to return between 900 and 1100 dollars, and an asset B expected to return something between 500 - 1500 dollars, then on the market should price A higher...
Market participants are usually assumed to be risk-averse and striving to improve the Sharpe ratios of their portfolios. Thus, if we have an asset A, which is expected to return between \$900 and \$1100, and an asset B which expected to return something between \$500 - \$1500, then on a market should price A higher. Fo...
Market participants are usually assumed to be risk-averse and striving to improve the Sharpe ratios of their portfolios. Thus, if we have an asset A, which is expected to return between \$900 and \$1100, and an asset B, which is expected to return something between \$500 - \$1500, then on the market should price A high...
Market participants are usually assumed to be risk-averse and striving to improve the Sharpe ratios of their portfolios. Thus, if we have an asset A, which is expected to return between \$900 and \$1100, and an asset B, which is expected to return something between \$500 - \$1500, then on the market should price A high...
Assuming that I have access to the historical daily closing price, it is possible to approximately calculate the daily price of an option? I understand that one pricing model is the Black-Scholes model. However this requires implied volatility (IV) to get an accurate result. As I understand it, IV cannot be calculated ...
How to calculate approximate historical price of options?
It's a very good question. This is also mentioned in "[Bond Math: the theory behind the formulas][1]" - but the author doesn't get into a lot of details, he just mentions it as some kind of a mathematical oddity, if I remember correctly. If there is a rigorous proof with a closed-form formula, the maths is beyond me...
* You are a market maker. * Charging no commission, your only aim is to remain market (delta) neutral. * Therefore you construct a portfolio of the form: $$\Pi = -C - w_{1} B + w_{2} S$$ where $B = K \cdot Z$ is the discounted future strike payment. Is this the PnL you would expect to see? [![enter image d...
Is this the PnL you would expect to see for a hedged call option portfolio?
## PDE Classification (Background) Linear second-order PDEs can be classified as either elliptic, parabolic or hyperbolic. A general PDE in two dimensions for $u=u(x,y)$ would look like $$Au_{xx}+2Bu_{xy}+Cu_{yy}+Du_x+Eu_y+Fu+G=0.$$ The PDE is called - hyperbolic if $B^2-AC>0$ (prime example: [Wave equation](h...
This question should be defined a little more clearly. What purpose is the model to have? Are you modelling the prices for short-term (predictive basis), medium-term (risk basis) or long-term (investment basis)? There are plenty of types of models for all purposes. Raphael Weron has plenty of research published on ...
## PDE Classification (Background) Linear second-order PDEs can be classified as either elliptic, parabolic or hyperbolic. A general PDE in two dimensions for $u=u(x,y)$ would look like $$Au_{xx}+2Bu_{xy}+Cu_{yy}+Du_x+Eu_y+Fu+G=0.$$ The PDE is called - hyperbolic if $B^2-AC>0$ (prime example: [Wave equation](h...
I am a finance student and during my free time I try to understand more financial products. Today I have found a term sheet for a specific type of barrier reverse convertible but I couldn't understand how it was built. Basically it's a product with the following characteristics: underlyings (in EURO): (basket of 1...
I am wondering whether there is a standard procedure to find a non attainable (i.e. non replicable) asset in an incomplete market. As an example, let us have the following market ($B = (B^1, B^2, B^3)$ is a $\mathbb{P}$-SBM): $$dX_t^0 = 0 \\ dX_t^1 = dt + dB_t^1 + dB_t^2 - dB_t^3 \\ dX_t^2 = 5dt - dB_t^1 + dB_t^2 +...
I know this is perhaps the type of answer you seek, but there are alternative hedging products such as PPAs which could help with this. PPAs can be structured in many ways to allow for parties involved to be happy with the outcome. An as-produced PPA would probably solve your above issue. However, the outcome from ...
In some notes, my professor writes the following for the price function of an geometric asian option: \begin{align} \text{Price}(t)&=\tilde{\mathbb{E}}\left[\left(S(0)\exp\left(\frac{T}{2}\left(r-\frac{\sigma^2}{2}\right)+\frac{\sigma}{T}\int_0^T\tau d\tilde{W}(t)\right)-K\right)_{+} | \mathcal{F}_{W}(t)\right]\\ ...
It's a very good question. This is also mentioned in "[Bond Math: the theory behind the formulas][1]" - but the author doesn't get into a lot of details, he just mentions it as some kind of a mathematical oddity, if I remember correctly. If there is a rigorous proof with a closed-form formula, the maths is beyond me...
Here is a hypothetical scenario: Bank A sells 1 SPX CALL/PUT to a retail trader who uses Bank B. The SPX becomes in the money. SPX is cash-settled. So Bank A transfers reserves held at Federal Reserve to Bank B to settle interbank liabilities. Is that allowed?
Can banks use reserves to settle liabilities arising from cash-settled options trading?
First off, note that the hedging is not a one-off affair that takes place along with the option sale. Instead, the hedges are adjusted (to match changes in delta) as the underlying price moves around (i.e. as the underlying experiences _realized volatility_ $\sigma_{r}$). The options will have been sold for some pa...
If I'm regressing changes in individual points along a yield curve and measures of changes in level/slope/curvature of that yield curve against the returns of some random variable then do I want to use % changes in yields or absolute changes in yields (eg yield change from 1% to 0.95% would be -0.05)? I am new to ...
### Q1. How to create an 'overlap' when we predict a stock price tomorrow based on information today? - According to the book 'Advances in Financial Machine Learning' written by Marcos Lopez de Prado, the concept 'purging' is introduced to reduce the information leakage from the training dataset to train dataset. ...
How to use 'purging' in predicting stock price tomorrow based on information today?
I have a [video][1] that goes into detail on this. Q1: Lets say your label is sign(5-day future return). If you look at 2 back-to-back days in a historical sample, the first day's label (t -> t+5) will contain 4 future days' returns (t+1 -> t+5) that are also included in the next days label (t+1 -> t+6). You want to...
I have a [video][1] that goes into detail on this. Q1: Lets say your label is sign(5-day future return). If you look at 2 back-to-back days in a historical sample, the first day's label (t -> t+4) will contain 4 future days' returns (t+1 -> t+4) that are also included in the next days label (t+1 -> t+5). You want to...
I am trying to simulate the paydown of a large pool of mortgage loans. For each monthly period, I am reducing principal by the scheduled principal payment (approximated by the WAC of the underlying loans) and prepayments governed by a CPR that is not random in the model. I want to incorporate random defaults and am qui...
### Q1. How to create an 'overlap' when we predict a stock price tomorrow based on information today? - According to the book 'Advances in Financial Machine Learning' written by Marcos Lopez de Prado, the concept 'purging' is introduced to reduce the information leakage from the training dataset to train dataset. ...
I had a discussion with a colleague of mine about the implications of risk modelling for the Gamestock/Wirecard cases in the recent weeks and that stock borrow rates could be an important risk factor at times, joint with the situation of different lending/borrowing fees. This makes option pricing models potentially ...
What's the point of complex option formula adjustments?
In the Basel pillar 2 framework a granularity adjustment is introduced. While the capital requirements in pillar 1 do not take concetrations into account, this is meant to be covered with this adjustment in pillar 2. In [Gordy and Lütkebohmert: Granularity Adjustment for Regulatory Capital Assessment](https://www.ijcb...
I would like to find some stats regarding UK Government debt. Any leads ? I am looking for following questions 1) Debt / GBP ? ( Got it already ) 2) Debt profile ( by maturity, instrument) 3) New debt issuance calendar ( how much monthly / annual) 4) QE ( how much monthly ? what do they buy ?
*New debt issuance calendar ( how much monthly / annual)* https://www.dmo.gov.uk/data/pdfdatareport?reportCode=D5J "This calendar includes all the key operational dates including gilt auction dates, the dates when auction sizes (and for new gilts the coupon) are announced and major redemptions. It also includes d...
*New debt issuance calendar ( how much monthly / annual)* https://www.dmo.gov.uk/data/pdfdatareport?reportCode=D5J "This calendar includes all the key operational dates including gilt auction dates, the dates when auction sizes (and for new gilts the coupon) are announced and major redemptions. It also includes d...
I keep hearing "analysts" say that certain company's stock is currently much below the fair value, and I also keep hearing that certain other stocks are severely over-valued. However, I have no idea how these analysts define fair value of a certain stock. Let us assume for now that we are not really looking at macro-ec...
> what's the point if your average trader simply uses Black-Scholes (BS) > and fudges all those real-wold problems like widening spreads, > suddenly significant borrow rates, etc. etc. into the "risk-free rate" > (with which we all can borrow and lend any amount, sure cough), the > "volatility of the stock" (yeah, ...