Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added IEX trading example #70

Merged
merged 23 commits into from
Nov 20, 2019
Merged

Added IEX trading example #70

merged 23 commits into from
Nov 20, 2019

Conversation

jlstevens
Copy link
Contributor

@jlstevens jlstevens commented Nov 12, 2019

This example visualizes trades made on the IEX exchange, building up to the following dashboard:

image

You can zoom in to reveal the metadata of individual trades:

image

There are three notebooks:

  1. IEX_to_CSV.ipynb which explains how the CSV files were generated from the pcap files offered by the exchange. This notebook is for reference and should not be tested in CI (the pcap files are very large).
  2. IEX_trading.ipynb which introduces the data and basic concepts needed to build a trade explorer.
  3. IEX_stocks.ipynb which generalizes IEX_trading.ipynb to build a useful dashboard.

On S3 there is IEX_2019-10-25.csv in addition to IEX_2019-10-21.csv: I am planning to use the former in yet another notebook aimed at comparing the two datasets. At this point, I think the material here is already complete enough to present without that extra example.

@jlstevens
Copy link
Contributor Author

Some other notes:

  • nodejs is listed as a dependency to build panel's Bokeh models. This shouldn't be required anymore (in the new panel dev release). I'll test that I can remove this now.
  • This holoviews PR will need to be merged and a dev release of holoviews used until those changes are released.

@jlstevens
Copy link
Contributor Author

@jbednar @philippjfr Some other annoyances that ought to be fixed:

  1. I have to loosen hv.config.image_rtol or datashader would break when zooming in (datetime related)
  2. I want to be using rasterize instead of spikes_aggregate but that would require holoviews to pass the parameters down (TODO).
  3. The formatting of volume on the colorbar is pretty ugly scientific notation when zoomed out.

I may expand this list if I remember anything else!

Copy link
Contributor

@jbednar jbednar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

iex_trading/anaconda-project.yml Show resolved Hide resolved
iex_trading/IEX_stocks.ipynb Outdated Show resolved Hide resolved
iex_trading/IEX_stocks.ipynb Outdated Show resolved Hide resolved
iex_trading/IEX_stocks.ipynb Outdated Show resolved Hide resolved
iex_trading/IEX_stocks.ipynb Outdated Show resolved Hide resolved
iex_trading/IEX_trading.ipynb Outdated Show resolved Hide resolved
iex_trading/IEX_trading.ipynb Outdated Show resolved Hide resolved
iex_trading/IEX_trading.ipynb Outdated Show resolved Hide resolved
iex_trading/IEX_trading.ipynb Outdated Show resolved Hide resolved
iex_trading/IEX_trading.ipynb Outdated Show resolved Hide resolved
dodo.py Show resolved Hide resolved
"source": [
"top_symbol_counts = df.symbol.value_counts()[:10]\n",
"top_symbols = list(top_symbol_counts.index)\n",
"top_symbol_info = (', '.join(top_symbols), top_symbol_counts.sum() /len(df) * 100)\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've switched to summing the trade volumes so maybe this should also state the fraction of the overall volume?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For that matter maybe select the top stocks by volume as well.

Copy link
Contributor Author

@jlstevens jlstevens Nov 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a bad suggestion even though the number of trades is what tests datashader performance, not the volume. The top stocks by trade counts are what will push datashader the hardest here and any ten stocks will do (all I need to do is select between some stocks). It might also be less cognitive overhead if I don't switch the names/symbols of the stocks inspected. @jbednar What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you're distinguishing number of trades from number of stocks traded? I guess I don't have much opinion; I'll leave it up to you as author of the example.

jlstevens and others added 8 commits November 14, 2019 09:52
Co-Authored-By: James A. Bednar <jbednar@users.noreply.github.com>
Co-Authored-By: James A. Bednar <jbednar@users.noreply.github.com>
Co-Authored-By: Philipp Rudiger <philippjfr@continuum.io>
Co-Authored-By: James A. Bednar <jbednar@users.noreply.github.com>
doc/conf.py Show resolved Hide resolved
@jlstevens
Copy link
Contributor Author

@jbednar @jsignell Ready to merge if we are ok depending on my holoviews branch for now (I'll try to get that merged soon). Will need updating once that code makes its way into a holoviews release.

labels:
- datashader
- panel
- holoviews
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be a badge here that indicates that this project is dev.

@jsignell jsignell merged commit b6031d8 into master Nov 20, 2019
@jsignell jsignell deleted the iex_trading branch November 20, 2019 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants