caesurus / short_volume Goto Github PK
View Code? Open in Web Editor NEWShort volume chart
Short volume chart
Issue
When first loading the app with no ticker symbol selected, it shows the error Callback error updating short-data-graph.figure, short-data-graph-raw.figure, short-data-table.figure
. The full error text (with API token removed):
Traceback (most recent call last):
File "/Users/me/venvs/short_venv/short_volume-main/render_chart.py", line 46, in update_graph
df_symbol_open_close = pd.read_json(URL)
File "/Users/me/venvs/short_venv/lib/python3.9/site-packages/pandas/util/_decorators.py", line 199, in wrapper
return func(*args, **kwargs)
File "/Users/me/venvs/short_venv/lib/python3.9/site-packages/pandas/util/_decorators.py", line 299, in wrapper
return func(*args, **kwargs)
File "/Users/me/venvs/short_venv/lib/python3.9/site-packages/pandas/io/json/_json.py", line 540, in read_json
json_reader = JsonReader(
File "/Users/me/venvs/short_venv/lib/python3.9/site-packages/pandas/io/json/_json.py", line 622, in __init__
data = self._get_data_from_filepath(filepath_or_buffer)
File "/Users/me/venvs/short_venv/lib/python3.9/site-packages/pandas/io/json/_json.py", line 659, in _get_data_from_filepath
self.handles = get_handle(
File "/Users/me/venvs/short_venv/lib/python3.9/site-packages/pandas/io/common.py", line 558, in get_handle
ioargs = _get_filepath_or_buffer(
File "/Users/me/venvs/short_venv/lib/python3.9/site-packages/pandas/io/common.py", line 289, in _get_filepath_or_buffer
req = urlopen(filepath_or_buffer)
File "/Users/me/venvs/short_venv/lib/python3.9/site-packages/pandas/io/common.py", line 195, in urlopen
return urllib.request.urlopen(*args, **kwargs)
File "/usr/local/Cellar/[email protected]/3.9.1_8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 214, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/Cellar/[email protected]/3.9.1_8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 517, in open
response = self._open(req, data)
File "/usr/local/Cellar/[email protected]/3.9.1_8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 534, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/usr/local/Cellar/[email protected]/3.9.1_8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 494, in _call_chain
result = func(*args)
File "/usr/local/Cellar/[email protected]/3.9.1_8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 1385, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File "/usr/local/Cellar/[email protected]/3.9.1_8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/urllib/request.py", line 1342, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/usr/local/Cellar/[email protected]/3.9.1_8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1255, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/Cellar/[email protected]/3.9.1_8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1266, in _send_request
self.putrequest(method, url, **skips)
File "/usr/local/Cellar/[email protected]/3.9.1_8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1100, in putrequest
self._validate_path(url)
File "/usr/local/Cellar/[email protected]/3.9.1_8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/http/client.py", line 1200, in _validate_path
raise InvalidURL(f"URL can't contain control characters. {url!r} "
http.client.InvalidURL: URL can't contain control characters. '/tiingo/daily/Pick Symbol to track/prices?startDate=nan&endDate=nan&token={TOKENREMOVED}' (found at least ' ')
Possible Cause
The app is sending "pick symbol to track" as part of the data request to Tiingo.
Solution
On initial app run, use first ticker in list. (More advanced: On subsequent runs, store last used ticker in DB and use that when running app).
Thanks for creating this awesome tool, @Caesurus! It's been a lot of fun to play with over the past two days.
Feature Request
When a user hovers over any given day on the main graph, show how synchronized the short volumes are.
Here is an extremely rough mockup example of what this could look like. I'm sure you can think of a better way to present this than I can. In this example, the sync level box would only show up when the user hovers over a day.
Please let me know if I can explain further.
It looks like NYSE also publishes short volume data in the same format as FINRA/NASDAQ inside their FTP site here: https://ftp.nyse.com/ShortData/ and https://ftp.nyse.com/ShortData/NYSEshvol/ along with data from the different exchanges around the country.
Maybe this can be added to the chart?
The new version of render_chart.py requires Sklearn which is not included in Requirements.txt
Not an issue but a feature recommendation. Since SEC fails-to-deliver data is in the same format as the short volume data, maybe it can be added as another data point? The data comes in 2 files per month. It tells us which stocks were heavily shorted and outperformed the market.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.