Hi All, I?m looking for a function in R to estimate Bid/Ask Spreads of stocks using Daily candlesticks. Can anyone suggest some implemetations? Thanks Diego
A Simple Estimation of Bid-Ask Spreads from Daily Close, High, and Low Prices
10 messages · Henrique Ramos, Adam Ginensky, Brian G. Peterson +4 more
On Tue, 2020-07-28 at 19:40 +0200, diego peroni wrote:
I?m looking for a function in R to estimate Bid/Ask Spreads of stocks using Daily candlesticks. Can anyone suggest some implemetations?
Diego, I would like to help you, but what you are asking for is simply impossible. Daily Range, Volume, and Volatility tells you nothing about the intraday numbers except their upper/lower bounds. It certainly doesn't tell you anything about intraday spreads. You can certainly *guess* that less liquid instruments have larger effective spreads, since this is usually the case, but you can't know *what* the spread is from daily data. Brian
Hi there, You can calculate the Corwin-Schultz (CS) spread estimator. https://onlinelibrary.wiley.com/doi/abs/10.1111/j.1540-6261.2012.01729.x One of the authors provides spreadsheets with calculations in Excel. It should not take much effort to put in R. You should notice that low-frequency proxies are highly subject to estimation errors. Em ter., 28 de jul. de 2020 ?s 14:40, diego peroni < diegoperoni1971 at gmail.com> escreveu:
Hi All, I?m looking for a function in R to estimate Bid/Ask Spreads of stocks using Daily candlesticks. Can anyone suggest some implemetations? Thanks Diego
_______________________________________________ R-SIG-Finance at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
-- Henrique P. Ramos [[alternative HTML version deleted]]
To expand on what Brian said, imagine a very illiquid stock that just trades once on the bid. No range, but probably a very wide bid/ask spread. On the other hand imagine a very liquid stock highly correlated to the market on a day with a large range- still will have a small bid/ask spread. On Tue, Jul 28, 2020 at 1:09 PM Brian G. Peterson <brian at braverock.com> wrote:
On Tue, 2020-07-28 at 19:40 +0200, diego peroni wrote:
I?m looking for a function in R to estimate Bid/Ask Spreads of stocks
using Daily candlesticks.
Can anyone suggest some implemetations?
Diego,
I would like to help you, but what you are asking for is simply impossible.
Daily Range, Volume, and Volatility tells you nothing about the intraday
numbers except their upper/lower bounds.
It certainly doesn't tell you anything about intraday spreads.
You can certainly *guess* that less liquid instruments have larger
effective spreads, since this is usually the case, but you can't know
*what* the spread is from daily data.
Brian
[[alternative HTML version deleted]]
_______________________________________________ R-SIG-Finance at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
perhaps something like: https://onlinelibrary.wiley.com/doi/full/10.1111/j.1540-6261.1984.tb03897.x ? is easy to write. On Tue, 28 Jul 2020 at 23:10, diego peroni <diegoperoni1971 at gmail.com> wrote:
Hi All, I?m looking for a function in R to estimate Bid/Ask Spreads of stocks using Daily candlesticks. Can anyone suggest some implemetations? Thanks Diego
_______________________________________________ R-SIG-Finance at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
Ajay Shah ajayshah at mayin.org http://www.mayin.org/ajayshah [[alternative HTML version deleted]]
Ajay, The method you are proposing is easy to write, the authors flat out say that they didn't really bother to check how accurate their measure is, but what little checking they do gives highly *implausible* results. They also say that it only makes sense for liquid instruments (for which intraday data is readily available anyway). So I'm not sure this makes the impossible any more possible. Brian
On Tue, 2020-07-28 at 23:50 +0530, Ajay Shah wrote:
perhaps something like: https://onlinelibrary.wiley.com/doi/full/10.1111/j.1540-6261.1984.tb03897.x ? is easy to write. On Tue, 28 Jul 2020 at 23:10, diego peroni <diegoperoni1971 at gmail.com
wrote: Hi All, I?m looking for a function in R to estimate Bid/Ask Spreads of stocksusing Daily candlesticks. Can anyone suggest some implemetations? ThanksDiego_______________________________________________R-SIG- Finance at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first.-- Also note that this is not the r-help list where general R questionsshould go.
I am not aware of any bid-ask spread estimators in R. I would be interested to know the intention with estimated bid-ask spreads (and how they compare with actual spreads) as they do sound dangerous if they were to be used in any system/model. The quoted papers are quite old, one dating back to 1984. The need for estimating bid-ask spreads was likely more necessary then than it is now when you can easily extract and store this information if you have access to the data.
On Tue, 28 Jul 2020 at 14:21, Ajay Shah <ajayshah at mayin.org> wrote:
perhaps something like: https://onlinelibrary.wiley.com/doi/full/10.1111/j.1540-6261.1984.tb03897.x ? is easy to write. On Tue, 28 Jul 2020 at 23:10, diego peroni <diegoperoni1971 at gmail.com> wrote:
Hi All, I?m looking for a function in R to estimate Bid/Ask Spreads of stocks using Daily candlesticks. Can anyone suggest some implemetations? Thanks Diego
_______________________________________________ R-SIG-Finance at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
-- Ajay Shah ajayshah at mayin.org http://www.mayin.org/ajayshah [[alternative HTML version deleted]]
_______________________________________________ R-SIG-Finance at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
Brian, You're right, of course. But the Roll's model was an influential work in 1980s when the bid/ask prices were not easily available (if at all). But the transactional prices were available ( 'time and sales' tapes). So, this model was a nice and useful theoretical exercise. ? Alec
From: R-SIG-Finance <r-sig-finance-bounces at r-project.org> on behalf of Brian G. Peterson <brian at braverock.com>
Sent: Tuesday, July 28, 2020 2:31 PM
To: Ajay Shah <ajayshah at mayin.org>; diego peroni <diegoperoni1971 at gmail.com>
Cc: r-sig-finance <r-sig-finance at r-project.org>
Subject: Re: [R-SIG-Finance] A Simple Estimation of Bid-Ask Spreads from Daily Close, High, and Low Prices
Sent: Tuesday, July 28, 2020 2:31 PM
To: Ajay Shah <ajayshah at mayin.org>; diego peroni <diegoperoni1971 at gmail.com>
Cc: r-sig-finance <r-sig-finance at r-project.org>
Subject: Re: [R-SIG-Finance] A Simple Estimation of Bid-Ask Spreads from Daily Close, High, and Low Prices
Ajay, The method you are proposing is easy to write, the authors flat out say that they didn't really bother to check how accurate their measure is, but what little checking they do gives highly *implausible* results. They also say that it only makes sense for liquid instruments (for which intraday data is readily available anyway). So I'm not sure this makes the impossible any more possible. Brian On Tue, 2020-07-28 at 23:50 +0530, Ajay Shah wrote: > perhaps something like: > https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fonlinelibrary.wiley.com%2Fdoi%2Ffull%2F10.1111%2Fj.1540-6261.1984.tb03897.x&data=02%7C01%7Caschmid1%40stevens.edu%7C510e7fca5b744d24f84208d833286343%7C8d1a69ec03b54345ae21dad112f5fb4f%7C0%7C0%7C637315595857504462&sdata=JSCJrQC%2BusDDIDvf7eTfJVhSakzms4AprrQ4IqHxu2s%3D&reserved=0 > > ? > is easy to write. > > On Tue, 28 Jul 2020 at 23:10, diego peroni <diegoperoni1971 at gmail.com > >wrote: > > Hi All, > > I?m looking for a function in R to estimate Bid/Ask Spreads of > > stocksusing Daily candlesticks. > > Can anyone suggest some implemetations? > > ThanksDiego_______________________________________________R-SIG- > > Finance at r-project.org mailing list > > https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-finance&data=02%7C01%7Caschmid1%40stevens.edu%7C510e7fca5b744d24f84208d833286343%7C8d1a69ec03b54345ae21dad112f5fb4f%7C0%7C0%7C637315595857504462&sdata=4u%2BnhRnGdruFMjmzD9AosEgMVwFly7tyNsaaeERLmIM%3D&reserved=0 > > -- Subscriber-posting only. If you want to post, subscribe first.-- > > Also note that this is not the r-help list where general R > > questionsshould go. [[alternative HTML version deleted]] _______________________________________________ R-SIG-Finance at r-project.org mailing list https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-finance&data=02%7C01%7Caschmid1%40stevens.edu%7C510e7fca5b744d24f84208d833286343%7C8d1a69ec03b54345ae21dad112f5fb4f%7C0%7C0%7C637315595857504462&sdata=4u%2BnhRnGdruFMjmzD9AosEgMVwFly7tyNsaaeERLmIM%3D&reserved=0 -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
Thanks Brian and others! I?m convinced that it?s not accurate but it can give me an idea of the magnitude in particular trading many stocks (global mean). I?ve found just this post: https://stackoverflow.com/questions/45916124/estimate-bid-ask-spreads-from-daily-high-and-low-prices-corwin-schultz-2012 <https://stackoverflow.com/questions/45916124/estimate-bid-ask-spreads-from-daily-high-and-low-prices-corwin-schultz-2012> Regards Diego
On 28 Jul 2020, at 21:10, Alec Schmidt <aschmid1 at stevens.edu> wrote: Brian, You're right, of course. But the Roll's model was an influential work in 1980s when the bid/ask prices were not easily available (if at all). But the transactional prices were available ( 'time and sales' tapes). So, this model was a nice and useful theoretical exercise. ? Alec From: R-SIG-Finance <r-sig-finance-bounces at r-project.org <mailto:r-sig-finance-bounces at r-project.org>> on behalf of Brian G. Peterson <brian at braverock.com <mailto:brian at braverock.com>> Sent: Tuesday, July 28, 2020 2:31 PM To: Ajay Shah <ajayshah at mayin.org <mailto:ajayshah at mayin.org>>; diego peroni <diegoperoni1971 at gmail.com <mailto:diegoperoni1971 at gmail.com>> Cc: r-sig-finance <r-sig-finance at r-project.org <mailto:r-sig-finance at r-project.org>> Subject: Re: [R-SIG-Finance] A Simple Estimation of Bid-Ask Spreads from Daily Close, High, and Low Prices Ajay, The method you are proposing is easy to write, the authors flat out say that they didn't really bother to check how accurate their measure is, but what little checking they do gives highly *implausible* results. They also say that it only makes sense for liquid instruments (for which intraday data is readily available anyway). So I'm not sure this makes the impossible any more possible. Brian On Tue, 2020-07-28 at 23:50 +0530, Ajay Shah wrote:
perhaps something like: https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fonlinelibrary.wiley.com%2Fdoi%2Ffull%2F10.1111%2Fj.1540-6261.1984.tb03897.x&data=02%7C01%7Caschmid1%40stevens.edu%7C510e7fca5b744d24f84208d833286343%7C8d1a69ec03b54345ae21dad112f5fb4f%7C0%7C0%7C637315595857504462&sdata=JSCJrQC%2BusDDIDvf7eTfJVhSakzms4AprrQ4IqHxu2s%3D&reserved=0 <https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fonlinelibrary.wiley.com%2Fdoi%2Ffull%2F10.1111%2Fj.1540-6261.1984.tb03897.x&data=02%7C01%7Caschmid1%40stevens.edu%7C510e7fca5b744d24f84208d833286343%7C8d1a69ec03b54345ae21dad112f5fb4f%7C0%7C0%7C637315595857504462&sdata=JSCJrQC%2BusDDIDvf7eTfJVhSakzms4AprrQ4IqHxu2s%3D&reserved=0> ? is easy to write. On Tue, 28 Jul 2020 at 23:10, diego peroni <diegoperoni1971 at gmail.com <mailto:diegoperoni1971 at gmail.com>
wrote: Hi All, I?m looking for a function in R to estimate Bid/Ask Spreads of stocksusing Daily candlesticks. Can anyone suggest some implemetations? ThanksDiego_______________________________________________R-SIG- Finance at r-project.org <mailto:Finance at r-project.org> mailing list https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-finance&data=02%7C01%7Caschmid1%40stevens.edu%7C510e7fca5b744d24f84208d833286343%7C8d1a69ec03b54345ae21dad112f5fb4f%7C0%7C0%7C637315595857504462&sdata=4u%2BnhRnGdruFMjmzD9AosEgMVwFly7tyNsaaeERLmIM%3D&reserved=0 <https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-finance&data=02%7C01%7Caschmid1%40stevens.edu%7C510e7fca5b744d24f84208d833286343%7C8d1a69ec03b54345ae21dad112f5fb4f%7C0%7C0%7C637315595857504462&sdata=4u%2BnhRnGdruFMjmzD9AosEgMVwFly7tyNsaaeERLmIM%3D&reserved=0> -- Subscriber-posting only. If you want to post, subscribe first.-- Also note that this is not the r-help list where general R questionsshould go.
[[alternative HTML version deleted]]
_______________________________________________ R-SIG-Finance at r-project.org <mailto:R-SIG-Finance at r-project.org> mailing list https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-finance&data=02%7C01%7Caschmid1%40stevens.edu%7C510e7fca5b744d24f84208d833286343%7C8d1a69ec03b54345ae21dad112f5fb4f%7C0%7C0%7C637315595857504462&sdata=4u%2BnhRnGdruFMjmzD9AosEgMVwFly7tyNsaaeERLmIM%3D&reserved=0 <https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-finance&data=02%7C01%7Caschmid1%40stevens.edu%7C510e7fca5b744d24f84208d833286343%7C8d1a69ec03b54345ae21dad112f5fb4f%7C0%7C0%7C637315595857504462&sdata=4u%2BnhRnGdruFMjmzD9AosEgMVwFly7tyNsaaeERLmIM%3D&reserved=0> -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
These methods are also useful in studying the past, where good datasets are unavailable. As an example, when Corwin/Schultz first came out, I had written https://blog.theleapjournal.org/2012/04/new-insights-into-events-on-indian.html On Wed, 29 Jul 2020 at 13:05, diego peroni <diegoperoni1971 at gmail.com> wrote:
Thanks Brian and others! I?m convinced that it?s not accurate but it can give me an idea of the magnitude in particular trading many stocks (global mean). I?ve found just this post: https://stackoverflow.com/questions/45916124/estimate-bid-ask-spreads-from-daily-high-and-low-prices-corwin-schultz-2012 < https://stackoverflow.com/questions/45916124/estimate-bid-ask-spreads-from-daily-high-and-low-prices-corwin-schultz-2012
Regards Diego
On 28 Jul 2020, at 21:10, Alec Schmidt <aschmid1 at stevens.edu> wrote: Brian, You're right, of course. But the Roll's model was an influential work in
1980s when the bid/ask prices were not easily available (if at all). But the transactional prices were available ( 'time and sales' tapes). So, this model was a nice and useful theoretical exercise. ?
Alec From: R-SIG-Finance <r-sig-finance-bounces at r-project.org <mailto:
r-sig-finance-bounces at r-project.org>> on behalf of Brian G. Peterson < brian at braverock.com <mailto:brian at braverock.com>>
Sent: Tuesday, July 28, 2020 2:31 PM To: Ajay Shah <ajayshah at mayin.org <mailto:ajayshah at mayin.org>>; diego
peroni <diegoperoni1971 at gmail.com <mailto:diegoperoni1971 at gmail.com>>
Cc: r-sig-finance <r-sig-finance at r-project.org <mailto:
r-sig-finance at r-project.org>>
Subject: Re: [R-SIG-Finance] A Simple Estimation of Bid-Ask Spreads from
Daily Close, High, and Low Prices
Ajay, The method you are proposing is easy to write, the authors flat out say that they didn't really bother to check how accurate their measure is, but what little checking they do gives highly *implausible* results. They also say that it only makes sense for liquid instruments (for which intraday data is readily available anyway). So I'm not sure this makes the impossible any more possible. Brian On Tue, 2020-07-28 at 23:50 +0530, Ajay Shah wrote:
perhaps something like:
https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fonlinelibrary.wiley.com%2Fdoi%2Ffull%2F10.1111%2Fj.1540-6261.1984.tb03897.x&data=02%7C01%7Caschmid1%40stevens.edu%7C510e7fca5b744d24f84208d833286343%7C8d1a69ec03b54345ae21dad112f5fb4f%7C0%7C0%7C637315595857504462&sdata=JSCJrQC%2BusDDIDvf7eTfJVhSakzms4AprrQ4IqHxu2s%3D&reserved=0 < https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fonlinelibrary.wiley.com%2Fdoi%2Ffull%2F10.1111%2Fj.1540-6261.1984.tb03897.x&data=02%7C01%7Caschmid1%40stevens.edu%7C510e7fca5b744d24f84208d833286343%7C8d1a69ec03b54345ae21dad112f5fb4f%7C0%7C0%7C637315595857504462&sdata=JSCJrQC%2BusDDIDvf7eTfJVhSakzms4AprrQ4IqHxu2s%3D&reserved=0
? is easy to write. On Tue, 28 Jul 2020 at 23:10, diego peroni <diegoperoni1971 at gmail.com
<mailto:diegoperoni1971 at gmail.com>
wrote: Hi All, I?m looking for a function in R to estimate Bid/Ask Spreads of stocksusing Daily candlesticks. Can anyone suggest some implemetations? ThanksDiego_______________________________________________R-SIG- Finance at r-project.org <mailto:Finance at r-project.org> mailing list
https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-finance&data=02%7C01%7Caschmid1%40stevens.edu%7C510e7fca5b744d24f84208d833286343%7C8d1a69ec03b54345ae21dad112f5fb4f%7C0%7C0%7C637315595857504462&sdata=4u%2BnhRnGdruFMjmzD9AosEgMVwFly7tyNsaaeERLmIM%3D&reserved=0 < https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-finance&data=02%7C01%7Caschmid1%40stevens.edu%7C510e7fca5b744d24f84208d833286343%7C8d1a69ec03b54345ae21dad112f5fb4f%7C0%7C0%7C637315595857504462&sdata=4u%2BnhRnGdruFMjmzD9AosEgMVwFly7tyNsaaeERLmIM%3D&reserved=0
-- Subscriber-posting only. If you want to post, subscribe first.-- Also note that this is not the r-help list where general R questionsshould go.
[[alternative HTML version deleted]]
_______________________________________________ R-SIG-Finance at r-project.org <mailto:R-SIG-Finance at r-project.org>
mailing list
https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-finance&data=02%7C01%7Caschmid1%40stevens.edu%7C510e7fca5b744d24f84208d833286343%7C8d1a69ec03b54345ae21dad112f5fb4f%7C0%7C0%7C637315595857504462&sdata=4u%2BnhRnGdruFMjmzD9AosEgMVwFly7tyNsaaeERLmIM%3D&reserved=0 < https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-sig-finance&data=02%7C01%7Caschmid1%40stevens.edu%7C510e7fca5b744d24f84208d833286343%7C8d1a69ec03b54345ae21dad112f5fb4f%7C0%7C0%7C637315595857504462&sdata=4u%2BnhRnGdruFMjmzD9AosEgMVwFly7tyNsaaeERLmIM%3D&reserved=0
-- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions
should go.
[[alternative HTML version deleted]]
_______________________________________________ R-SIG-Finance at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.
Ajay Shah ajayshah at mayin.org http://www.mayin.org/ajayshah [[alternative HTML version deleted]]