Re: [R-SIG-Finance] Save a plot

2020-07-28 Thread Brian G. Peterson
The problem is that you need to open the png device, call your plots, and then close the device. You would do the same e.g. with a pdf. Try something like this: ## library(PerformanceAnalytics) library(quantmod) library(png) png("plot-1.png", width=1000, height=600)

[R-SIG-Finance] Save a plot

2020-07-28 Thread Pedro páramo
Hi all I want to save a code on a png but it saves me a png with 0k (nothing on the plot) but I see it on R-Studio. No error is happening, what should be happening? Many thanks for your help library(PerformanceAnalytics) library(dplyr) library(tibble) library(lubridate)

Re: [R-SIG-Finance] A Simple Estimation of Bid-Ask Spreads from Daily Close, High, and Low Prices

2020-07-28 Thread Alec Schmidt
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

Re: [R-SIG-Finance] A Simple Estimation of Bid-Ask Spreads from Daily Close, High, and Low Prices

2020-07-28 Thread Jasen Mackie
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

Re: [R-SIG-Finance] A Simple Estimation of Bid-Ask Spreads from Daily Close, High, and Low Prices

2020-07-28 Thread Brian G. Peterson
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

Re: [R-SIG-Finance] A Simple Estimation of Bid-Ask Spreads from Daily Close, High, and Low Prices

2020-07-28 Thread Ajay Shah
perhaps something like: https://onlinelibrary.wiley.com/doi/full/10./j.1540-6261.1984.tb03897.x ? is easy to write. On Tue, 28 Jul 2020 at 23:10, diego peroni wrote: > Hi All, > > I’m looking for a function in R to estimate Bid/Ask Spreads of stocks > using Daily candlesticks. > > Can

Re: [R-SIG-Finance] A Simple Estimation of Bid-Ask Spreads from Daily Close, High, and Low Prices

2020-07-28 Thread Adam Ginensky
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

Re: [R-SIG-Finance] A Simple Estimation of Bid-Ask Spreads from Daily Close, High, and Low Prices

2020-07-28 Thread Henrique Ramos
Hi there, You can calculate the Corwin-Schultz (CS) spread estimator. https://onlinelibrary.wiley.com/doi/abs/10./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

Re: [R-SIG-Finance] A Simple Estimation of Bid-Ask Spreads from Daily Close, High, and Low Prices

2020-07-28 Thread Brian G. Peterson
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

[R-SIG-Finance] A Simple Estimation of Bid-Ask Spreads from Daily Close, High, and Low Prices

2020-07-28 Thread diego peroni
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@r-project.org mailing list