instruction
stringlengths
15
26.1k
Algorithm for the choice of stocks for a equity scalper/market maker to engage in?
Assume a scalper/market maker who is operating on an exchange with $N$ stocks with different characteristics such as current market value, average bid-ask spread, average daily volume and historical volatility. Due to constraints imposed on this market maker he can only engage in $n$ of the $N$ stocks on the exchan...
The problem with this question is that the real world answer is probably different than any theoretical answer. Below is my stab at some "real world" nonsense. 1) Assuming that both Foo and Bar have the same market capitalization and no debt, their market caps would be co-integrated (over time, they wouldn't stray...
That's the problem with China. The official data is nonsense, and the estimates of outsiders can change without warning. Here are some links: [China Official Stats 1][1] [China Official Stats 2][2] [China Official Stats 3][3] [More China Stats][4] [OECD][5] [CIA][6] [World Bank 1][7] [World ...
That's the problem with China. The official data is nonsense, and the estimates of outsiders can change without warning. Here are some links: [China Official Stats 1][1] [China Official Stats 2][2] [China Official Stats 3][3] [More China Stats][4] [OECD][5] [CIA][6] [World Bank 1][7] [World ...
I'm hoping someone could help me understand this subject better. Basically I am reading a book and it shows a table Coupon Rate | 10 yrs | 20 yrs | 30 yrs | 50 yrs 3% | 7.894 | 11.744 | 12.614 | 11.857 6% | 7.030 | 9.988 | 10.952 | 11.200 ...
I'd like to calculate the local volatility surface for a series of option strikes, similar to the surface described in this paper: http://www.ederman.com/new/docs/gs-local_volatility_surface.pdf This is the image I am referring to in the aforementioned paper: ![enter image description here][1] I know QuantL...
How to calculate the local volatilty surface using QuantLib?
Buying and Selling Volatility by Kevin Connolly. This book has an amazing property: it explains options at an intuitive level, without any math. Incredible. Once you have gone through the first few chapters, you get to the point of being able to roughly value options in your head with some simple arithmetic, and und...
I'd like a library to calculate the local volatility surface, i.e. the implied volatility surface for a collection of strikes and their bid/ask prices. Here are the libraries I've looked at: * QuantLib. * [NAG][1]. * [Intermark Tookits][2]. * [Modelling the implied volatility surface: an empirical study for F...
Recommendation for a library to calculate the local volatility surface?
I'd like a library to calculate the options local volatility surface, i.e. the options implied volatility surface for a collection of strikes and their bid/ask prices. Here are the libraries I've looked at: * [QuantLib][1] (Quote: "from memory, the function qlBlackVol will interpolate vols making sure that the s...
Buying and Selling Volatility by Kevin Connolly. This book has an amazing property: it explains options at an intuitive level, without any math. Incredible. Once you have gone through the first few chapters, you get to the point of being able to roughly value options in your head with some simple arithmetic, and int...
I'd like a library to calculate the options local volatility surface, i.e. the options implied volatility surface for a collection of strikes and their bid/ask prices. Here are the libraries I've looked at: * [QuantLib][1] (Quote: "from memory, the function qlBlackVol will interpolate vols making sure that the s...
I'm looking for an implementation of [Arbitrage-Free Smoothing of the Implied Volatility Surface - Matthias R. Fengler][1]. Does anyone know of any existing libraries that have implemented this paper? Any method is ok (Excel, C++, Matlab, Mathematica, C#, etc). [1]: http://edoc.hu-berlin.de/series/sfb-649-pap...
Lib for Arbitrage-Free Smoothing of Implied Volatility Surface?
I'm looking for an implementation of [Arbitrage-Free Smoothing of the Implied Volatility Surface - Matthias R. Fengler][1]. Does anyone know of any existing libraries that have implemented this paper? Any method is ok (Excel, C++, Matlab, Mathematica, C#, etc). In fact, any method that implements arbitrage free s...
"Buying and Selling Volatility" by Kevin Connolly. This book has an amazing property: it explains options at an intuitive level, without any math. Incredible. Once you have gone through the first few chapters, you get to the point of being able to roughly value options in your head with some simple arithmetic, and i...
My current project requires large amounts of market data (1m or 5m bars for various products, mostly US futures for as far back as available). This data will be analyzed by software, so accessing the data through the internet for each price is not going to cut it, we need local data for speed. There are many online ...
My current project requires large amounts of historical and real-time market data (1m or 5m bars for various products, mostly US futures for as far back as available). This data will be analyzed by software, so accessing the data through the internet for each price is not going to cut it, we need local data for speed. ...
I think you should put YOUR attainable interest rate. Because it is your view of how much the forward is worth. So, on the offer the rate at which you are indifferent is computed with the interest rate at which you borrow. And if you go short, the interest at which you can put your have your money fructified. No wha...
I'd like to calculate the local volatility surface for a series of option strikes, similar to the surface described in this paper: http://www.ederman.com/new/docs/gs-local_volatility_surface.pdf This is the image I am referring to in the aforementioned paper: ![enter image description here][1] I know QuantL...
How to calculate the local volatility surface using QuantLib?
Are there any free/cheap sources for historical data on company earnings and valuations? I can get historical price data from google and yahoo, and it looks like I can get about 5 years of historical balance sheet data from google using quantmod in R. Are there any longer-term sources of for these kind of data? Bo...
Are there any free/cheap sources for historical data on company earnings and valuations? I can get historical price data from Google and Yahoo, and it looks like I can get about five years of historical balance sheet data from Google using [quantmod][1] in R. Are there any longer-term sources of for these kind of dat...
Assume a class `LimitOrderBook` which represents a limit order book in a trading system. To be able to represent the limit order book a data handler reads a feed which adds data to the representation of the limit order book using the following three methods: * `public OrderReference add(Order order)` * `public b...
A generic limit order book: What are the most important queries it should be able to answer?
Lets say that I have an imaginary model that always gives me a 10% edge over straight 50/50 odds, one day in advance, for an index (i.e. 60% chance of winning / 40% chance of losing). How would I calculate the ideal position size to maximize long term portfolio gain, given a chosen risk threshold?
If I have a model that gives 10% "probability edge" over random chance, how do I calculate the position size?
Lets say I want to find out the area under the graph of normal distribution curve, between X1=standard deviation of -0.5 and X2 = standard deviation of 0.5. Is there a formula for this? Case study: find the percentage chance of a stock remaining within +0.5 and -0.5 standard deviations, given the implied volatility ...
Whats the equation to calculate the area under the curve of a normal distribution, given an upper and lower standard deviation?
"Buying and Selling Volatility" by Kevin Connolly. This book has an amazing property: it explains options at an intuitive level, without any math. Incredible. Once you have gone through the first few chapters, you get to the point of being able to roughly value options in your head with some simple arithmetic, and i...
Lets say I want to find out the area under the graph of normal distribution curve, between X1=standard deviation of -0.5 and X2 = standard deviation of 0.5. Is there a formula for this? Case study: find the percentage chance of a stock remaining within +0.5 and -0.5 standard deviations within one trading day, given ...
See [Marco's list of CEP vendors][1]. I'm currently using StreamInsight, Microsoft's new CEP engine. I'd rate it as slightly better than NEsper, for the following reasons: * Supports LINQ natively within Visual Studio. * Better documentation (in my opinion). * Good samples. * Complete training course (see ...
Assume a class `LimitOrderBook` which represents a limit order book in a trading system. To be able to represent the limit order book a data handler reads a feed which adds data to the representation of the limit order book using the following three methods: * `public OrderReference add(Order order)` * `public b...
Does anyone know of a utility which can download historical Implied Volatility (IV) data from [Interactive Brokers' Trader Workstation][1]? The IV is for at-the-money implied volatility, normalized to a rolling 30 days in the future, and is apparently available in 1-min bars up to a year in the past for any symbol. ...
Utility to download historical Implied Volatility data from Interactive Brokers?
Does anyone know of a utility which can download historical Implied Volatility (IV) data from [Interactive Brokers' Trader Workstation][1]? The IV is for at-the-money implied volatility, normalized to a rolling 30 days in the future, and is available in 1-min bars up to a year in the past for any symbol. [1]: ht...
Consider a market maker that has decided to try to make a round-trip trade in stock A in order to capture the bid-ask spread. Assume furthermore that he has no current inventory in the stock A. To further simplify things assume that he wants to trade only one share in stock A. The market maker now has to choose i...
Order submission strategies of a rational market maker?
Does anyone know of a utility which can download historical Implied Volatility (IV) data from [Interactive Brokers' Trader Workstation][1]? [1]: http://www.interactivebrokers.com/
Does anyone know of a utility that can download historical Implied Volatility (IV) data from [Interactive Brokers' Trader Workstation][1]? [1]: http://www.interactivebrokers.com/
VIX (spot) has very nice features, including mean reverting one. We all know that we can't trade VIX (spot). The closest we can get is using front month future contracts... the problem I have with that is that is practice vix futures are not great at tracking VIX... is there a way to replicate tradable VIX? Any thou...
Say you have a trading system that works best when markets are most volatile. What would be the best way to hedge against lack of volatility ? For example, 2008, 2009 was highly volatile and it has been trending down since. What's the best way to hedge and if VIX is the best one ?
VIX (spot) has very nice features, including mean reversion. We all know that we can't trade VIX (spot). The closest we can get is using front-month future contracts. The problem I have with that is that, in practice, VIX futures are not great at tracking VIX. Is there a way to replicate tradable VIX?
Do you have historical market/pricing ticket data that you would like to donate to the [Open Source Trader][1] project (OST)?? Please: upload your files! Once we gather some data, we'll do our best to help create an excellent web-service (RESTFul API) based repository of free market tick data. If we can afford the ...
Do you have historical tick data you want to donate?
How the two modelling frameworks compare? I spent some time developing PD LGD and EAD models for banking portfolios... But I neved did insurance modelling project which I suspect is based on Solvency II? Any comments are highly appreciated!
Basel II modelling vs Solvency II modelling?
I am looking for the S&P 500 index list of stocks for each day since January 1, 1960. Does anyone know where I can find these lists?
What are practically useful ways of modelling the effect of liquidity on options?
(Edited) An option trade has 2 main components : 1st derivative, and 2nd derivative wrt to the spot. But if you need to play 1st derivative, you just buy the stocks right? So if you consider buying a stock that mean you are there for the 2nd order derivative. That's what options are all about. And that's why...
I want to try out the [Vickrey auction][1] for a project of mine, but I'm not sure that I understand it completely. The thing is that I have several consumers and several providers trading one resource type on the market. If I have just one provider and several consumers, the things are pretty straight forward. But wha...
What are the exceptions set by the [CFTC][1] which exempt [Commodity Pool Operators][2] (CPO) from registering as such? [1]: http://www.cftc.gov/ [2]: http://en.wikipedia.org/wiki/Commodity_Pool_Operator
I am experimenting with Monte Carlo methods. I'd like to measure/estimate convergence with a graph/chart. How do I do that? Can anyone please direct me to relevant documentation/links or even give me tips or general guidelines? Thanks in advance, Julien.
I know what random variables are but I don't understand what a linear combination of gaussian random variables is. Can anyone please give me an explanation or clues? Thanks in advance, Julien.
Say I have two risk factors $X_1$ and $X_2$. Standard deviation for $X_1$ is $\sigma_1$ and $\sigma_2$ for $X_2$. Furthermore, $X_1$ has a mean of $\mu_1$ and $X_2$ has a mean of $\mu_2$. Correlation between $X_1$ and $X_2$ is $\rho$. The system is as follows: $X_1=\mu_1 + \lambda_{11} U_1$ $X_2=\mu_2 + \lambda_{2...
Say I have two risk factors $X_1$ and $X_2$. Standard deviation for $X_1$ is $\sigma_1$ and $\sigma_2$ for $X_2$. Furthermore, $X_1$ has a mean of $\mu_1$ and $X_2$ has a mean of $\mu_2$. Correlation between $X_1$ and $X_2$ is $\rho$. The system is as follows: $X_1=\mu_1 + \lambda_{11} U_1$ $X_2=\mu_2 + \lambda_{2...
Say I have two risk factors $X_1$ and $X_2$. Standard deviation for $X_1$ is $\sigma_1$ and $\sigma_2$ for $X_2$. Furthermore, $X_1$ has a mean of $\mu_1$ and $X_2$ has a mean of $\mu_2$. Correlation between $X_1$ and $X_2$ is $\rho$. The system is as follows: $$\begin{eqnarray} X_1 & = & \mu_1 + \lambda_{11} U...
I am running a mean reversion strategy. I have question with regards to half-life; I have heard of OU process to determine the high life but it's not giving me the kind of result. Can any one advise on other way to identify half life or else any other indicator that I can use to trade to support my Z score?
I would like to check the co-variance of an index with a basket of fifteen stocks. What would be an ideal way to go about it? Should I use one-tail ANOVA test or individual stock & index F-test?
Can any one help me with some R code to run Ornstein-Uhlenbeck_process?
All of these index constituents are available on Bloomberg and through Bloomberg Excel link. Just use one of those Index member formulas with a date override. http://libfaq.smu.edu.sg/a.php?qid=2998
I'm backtesting a trading strategy, using free OHLC data from yahoo or google. I'm simulating friction by lopping a flat percentage (say 0.5%) off my returns for each day that I make a trade. Whats a good way to simulate [slippage][1]? I tried '[torturing][2]' my returns, by pretending that I always buy at the day's...
As in the subject, I'm interested in a math puzzle of sorts: If stock A has a 60% chance of rising, and stocks A and B have an 80% correlation, what is the chance of stock B rising? Would it be possible to extend this concept so that if we know the probabilities of stocks A,B,C,D rising, we can work out the proba...
If stock A has a 60% chance of rising, and stocks A and B have 80% correlation, what is the chance of stock B rising?
I have two stocks, A and B, that are correlated in some way. If I know (hypothetically) that stock A has a 60% chance of rising by the 24 hour mark tomorrow, and I know the joint probability between stocks A and B, how do I calculate the probability density function of the future movements of stock B at the 24 hour ...
How do I estimate the joint probability of stock A and B?
I have two stocks, A and B, that are correlated in some way. If I know (hypothetically) that stock A has a 60% chance of rising by the 24 hour mark tomorrow, and I know the joint probability between stocks A and B, how do I calculate the probability density function of the future movements of stock B at the 24 hour ...
Back in the "old days" (ie 5-10 years ago) when we wanted to be long or short an emerging currency (say the ZAR, BRL, or TRY) we simply did everything against the pre-eminent currency of the day, the dollar. So for example to be long the Turkish Lira, we sold USDTRY. Short the rand, we bought USDZAR. Most of the return...
How do I eliminate developed currency funding cross rate risk in an EMFX long?
Back in the "old days" (ie 5-10 years ago) when we wanted to be long or short an emerging currency (say the ZAR, BRL, or TRY) we simply did everything against the pre-eminent currency of the day, the dollar. So for example to be long the Turkish Lira, we sold USDTRY. Short the rand, we bought USDZAR. Most of the return...
How do I eliminate developed currency funding cross rate risk in an EMFX position?
Back in the "old days" (ie 5-10 years ago) when we wanted to be long or short an emerging currency (say the ZAR, BRL, or TRY) we simply did everything against the pre-eminent currency of the day, the dollar. So for example to be long the Turkish Lira, we sold USDTRY. Short the rand, we bought USDZAR. Most of the return...
Consider a market participant $A$ who is mechanically following an automated liquidity providing algorithm (HFT) in a number of large cap stocks on a specific exchange. Assume furthermore that we are able to observe all orders placed by $A$ and that we know that the algorithm used by $A$ takes only public market dat...
Suppose quantified duration (like Maclayan duration with changing intervals) $Dur = \frac{\sum t_{i} PV_{i}}{\sum PV_{i}}$ and two funds having durations $D_{a}$ and $D_{b}$. You own them in the propertion $w_{a}=0.4$ and $w_{b}=0.6$. 1. What is the duration of your portfolio? 2. Is it the following? $C_{newDur...
Is duration additive? $C_{newDur}=A_{fundDur}w_{a} + B_{fundDur}w_{b}$?
Consider a market participant $A$ who is mechanically following an automated liquidity providing algorithm (HFT) in a number of large cap stocks on a specific exchange. Assume furthermore that we are able to observe all orders placed by $A$ and that we know that the algorithm used by $A$ takes only public market dat...
Consider a market participant $A$ who is mechanically following an automated liquidity providing algorithm (HFT) in a number of large cap stocks on a specific exchange. Assume furthermore that we are able to observe all orders placed by $A$ and that we know that the algorithm used by $A$ takes only public market dat...
I'm wondering what API methods there are to determine a companies market cap, i.e. number of shares issued * price per share. I know IQfeed and perhaps Yahoo will do this - does anyone know of any other API's that will do the job?
What API methods are there to determine a companies market cap?
Suppose quantified duration (like Macaulay duration with changing intervals) $Dur = \frac{\sum t_{i} PV_{i}}{\sum PV_{i}}$ and two funds having durations $D_{a}$ and $D_{b}$. You own them in the proportion $w_{a}=0.4$ and $w_{b}=0.6$. 1. What is the duration of your portfolio? 2. Is it the following? $C_{newDur...
I'm wondering what API methods there are to determine a companies market cap, i.e. number of shares issued * price per share. I know IQfeed and perhaps Yahoo will do this - does anyone know of any other API's that will do the job?
I have two stocks, A and B, that are correlated in some way. If I know (hypothetically) that stock A has a 60% chance of rising tomorrow, and I know the joint probability between stocks A and B, how do I calculate the probability of stock B moving tomorrow? For bonus upvotes - do you know of any standard librarie...
How do I estimate the joint probability of stocks B moving, if stock A moves?
Consider a market participant $A$ who is mechanically following an automated liquidity providing algorithm (HFT) in a number of large cap stocks on a specific exchange. Assume furthermore that we are able to observe all orders placed by $A$ and that we know that the algorithm used by $A$ takes only public market dat...
Since I began to think about portfolio optimization and option prizing I am struggling to get an intuition for the risk premium, i.e. that investors are only willing to buy risky instruments when they are compensated by an add-on above $r$ (the risk free interest rate). On the one hand this is understandable and bac...
Debunking risk premium via hedging argument? (or why even in the real world $\mu$ should equal $r$)
Debunking risk premium via "hedging" argument? (or why even in the real world $\mu$ should equal $r$)
Suppose quantified duration (like Macaulay duration with changing intervals) $Dur = \frac{\sum t_{i} PV_{i}}{\sum PV_{i}}$ and two funds having durations $D_{a}$ and $D_{b}$. You own them in the proportion $w_{a}=0.4$ and $w_{b}=0.6$. 1. What is the duration of your portfolio? 2. Is it the following? $C_{newDur...
How do I estimate the joint probability of stock B moving, if stock A moves?
I also find the "risk premium" idea unsatisfying, but I don't think your hedging argument works. Because hedging implies correlation, the risk free asset needs to be well correlated with the risky one in order for you to make any spread between the two. Are you saying that someone should be able to earn the risk prem...
Since I began thinking about portfolio optimization and option pricing, I've struggled to get an intuition for the risk premium, i.e. that investors are only willing to buy risky instruments when they are compensated by an add-on above $r$ (the risk free interest rate). On the one hand this is understandable and bac...
I'm wondering what API methods there are to determine a company's market cap, i.e. number of shares issued * price per share. I know IQfeed and perhaps Yahoo will do this - does anyone know of any other API's that will do the job?
What API methods are there to determine a company's market cap?
what would you suggest are the starting points for comparing, in an easy, visual way, implied and delivered volatility surfaces? I'd like to show my clients what the differences are between the historic surfaces, and the implied surfaces. Implieds are easy enough: ![enter image description here][1] But how wo...
How do I compare implied and historic volatility?
As in the subject, I'm interested in a math puzzle of sorts: If stock A has a 60% chance of rising, and stocks A and B have an 80% correlation, what is the chance of stock B rising? Would it be possible to extend this concept so that if we know the probabilities of stocks A,B,C,D rising, we can work out the proba...
what would you suggest are the starting points for comparing, in an easy, visual way, implied and delivered volatility surfaces? I'd like to see what the differences are between the historic surfaces, and the implied surfaces. Implieds are easy enough: ![enter image description here][1] But how would you go a...
what would you suggest are the starting points for comparing, in an easy, visual way, implied and delivered volatility surfaces? I'd like to see what the differences are between the historic surfaces, and the implied surfaces. Implieds are easy enough, for example USDBRL: ![enter image description here][1] Bu...