This Gist hosts the code from my talk and brief coding session at Plotcon.
- tick data server with ZeroMQ
- tick data client with ZeroMQ
- tick data plotting with plotly
- Flask app embedding the streaming plot
| # | |
| # TsTables -- High Frequency Times Series Data with PyTables | |
| # | |
| # to install -- pip install tstables | |
| # Github repo -- https://github.com/afiedler/tstables | |
| # | |
| # Dr. Yves J. Hilpisch | |
| # | |
| # The Python Quants GmbH | |
| # http://quant-platform.com |
| import zmq | |
| context = zmq.Context() | |
| socket = context.socket(zmq.SUB) | |
| socket.connect('tcp://0.0.0.0:8888') | |
| socket.setsockopt_string(zmq.SUBSCRIBE, u'value') | |
| while True: | |
| data = socket.recv_string() | |
| print(data) |
| c.NotebookApp.certfile='/cert.pem' | |
| c.NotebookApp.keyfile='/cert.key' | |
| c.NotebookApp.password='sha1:768ce7b87bf6:fa6013a02f7053bc014ef7c65be0ef34f77f21fd' | |
| c.NotebookApp.ip='*' | |
| c.NotebookApp.port=8888 | |
| c.NotebookApp.open_browser=False |
| # | |
| # Backtesting Algo Strategies based on | |
| # Logistic Regression with scikit-learn | |
| # | |
| # Yves Hilpisch | |
| # ODSC London 2016 | |
| # The Python Quants GmbH | |
| # | |
| import numpy as np |
| import numpy as np | |
| import pandas as pd | |
| import matplotlib.pyplot as plt | |
| import seaborn as sns; sns.set() | |
| from pandas_datareader import data as web | |
| class StrategyOptimizer(object): | |
| def __init__(self, symbol, start, end, t1, t2): | |
| self.symbol = symbol | |
| self.start = start |
| # | |
| # Python for Algorithmic Trading | |
| # Quant Insights Bootcamp | |
| # | |
| # The Python Quants | |
| # | |
| import numpy as np | |
| import pandas as pd | |
| import seaborn as sns; sns.set() | |
| from pandas_datareader import data as web |
| Class | Sex | Age | Survived | Freq | ||
|---|---|---|---|---|---|---|
| 1 | 1st | Male | Child | No | 0 | |
| 2 | 2nd | Male | Child | No | 0 | |
| 3 | 3rd | Male | Child | No | 35 | |
| 4 | Crew | Male | Child | No | 0 | |
| 5 | 1st | Female | Child | No | 0 | |
| 6 | 2nd | Female | Child | No | 0 | |
| 7 | 3rd | Female | Child | No | 17 | |
| 8 | Crew | Female | Child | No | 0 | |
| 9 | 1st | Male | Adult | No | 118 |
| Welcome to the Algo Trading Bootcamp | |
| ==================================== | |
| WIFI | |
| ==== | |
| Ft1ch#2016#! | |
| Quant Platform | |
| ============== |
| # | |
| # Stock Market Prediction | |
| # with Linear Regression | |
| # | |
| # The Python Quants GmbH | |
| # | |
| import numpy as np | |
| import pandas as pd | |
| from pandas_datareader import data as web | |
| import seaborn as sns |