Closed ghost closed 7 years ago
Could you share which stock you're talking about? Chances are good that no stock was traded on those days, and thus it cannot plot a candlestick because each value is the same.
Its a small Norwegian company. A bank Indre Sogn Sparebank (ISSG) . You probably dont know it.
The data looks like this
symbol date open high low close
The reason your plot is not working is because there are either few securities traded on many of the days. For example, in the first row, each value is the same. This is because the stock's value did not change at any point throughout the day, most likely due to it not being traded. You can verify this by looking at the stock's volume on each day.
This is not really a tidyquant problem, it has more to do with the fact that candlesticks work best for actively traded securities in liquid markets. They're not really best for sporadically traded illiquid assets. Hopefully this has answered your question.
Hi Cameron, Yes, I understand your point. This is probably a problem with my data. I guess if open/high/low/close has the same value, the data point shouldnt be there at all.
Have to ask my data provider why they have registered this data point. Thanks for your comment.
2017-04-12 11:41 GMT+02:00 Cameron Pfiffer notifications@github.com:
The reason your plot is not working is because there are either few securities traded on many of the days. For example, in the first row, each value is the same. This is because the stock's value did not change at any point throughout the day, most likely due to it not being traded. You can verify this by looking at the stock's volume on each day.
This is not really a tidyquant problem, it has more to do with the fact that candlesticks work best for actively traded securities in liquid markets. They're not really best for sporadically traded illiquid assets. Hopefully this has answered your question.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/business-science/tidyquant/issues/34#issuecomment-293526484, or mute the thread https://github.com/notifications/unsubscribe-auth/AXL1ENGUm3m381Cmq37Ro_ZeeWUG72Ufks5rvJxCgaJpZM4M7G6t .
There is no issue with your data provider, and this data is indeed supposed to be present. There are many securities similar to yours that are not actively traded, and their values tend to stay the same throughout. The fact that the values haven't changed is valuable in itself, and many models make use of the fact that securities are unchanged in price and are not traded. The data reflects reality accurately, that this security is not traded.
Yes but it changes from day to day. For example first two rows have different values, so I think they have only registered close prices and filled this out for ohlc.
If I add, volume columns, the data looks like this. So the stock gets traded on those days, but they havent registered ohlc correctly I think.
symbol date open high low close volume
I believe there is a fundamental misunderstanding here about how these values are recorded.
Take for example the difference between the first and second row on your data set. On the second row, one or more stocks was traded at the open call auction at the beginning of the day, and the open price was changed from the previous close of 76.79630 (on day 1) to the open of 77.03704 (on day 2). Because the security was traded only at the open and at no other point during the day, the open, the high, the low, and the close are all the same price. Not a single security was traded from this day through the sixth row, and a similar event happened on the seventh row, where a security was traded at the open call auction at the beginning of the day.
If you go here and look at the historical pricing and volume, you will notice that very, very small amounts of securities are being traded. Chances are good that these trades are all being performed at the midpoint or limit orders set at the open price, and hence the OHLC data does not change, because the price remains the same throughout the day.
Compare this to a more active stock like Apple, and you will see millions of stocks trade hands during the day, many of which at different prices. ISSG is simply not active enough to display intraday price differentials. Your data is accurate, and the problem has more to due with the nature of small-cap securities like this.
Yes, I understand. The volume is very small indeed so probably no significant change during the days.
but back to my initial suggestion. If you look at the candlestick plot on the link you sent me. You will see a horizontal dash on days where ohlc is the same. https://markets.ft.com/data/equities/tearsheet/charts?s=ISSG:OSL
I dont think this is the case in tidyquant candletick.
Great link by the way. Thanks!
Thanks @Nygdat and @cpfiffer for identifying and working through some of the issues with the OHLC data that has the same values throughout the day. I'll have to see what I can do here. I do think its a case that really is better suited for a geom_line plot if direction is not changing. However, maybe there is something we can do to at least show a small line segment indicating the price. I agree with @cpfiffer that this is technically not a bug, but probably something to look into as a feature enhancement.
thanks @mdancho84 for your reply. I agree with you that this is not a bug.
When open/close are virtually the same, this is called a Doji candlestick. It is a special case. Here you can find the description.
Looking at some of my plots, Im not sure if this isn't already implemented though..it looks correct.
Hi, I dont know if this is done intentionally but I have some data where open/high/low/close has the same value.
When I plot with geom_candlestick the plot renders empty.
Somebody told me the standard way to plot this is to have a horizontal dash/line (black)? Just a suggestion.
regards, Lars Nygaard