Skip to content

Instantly share code, notes, and snippets.

@yhilpisch
Last active January 22, 2024 06:50
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save yhilpisch/e252d9f1d0a4f8306b68ff5e023fde3b to your computer and use it in GitHub Desktop.
Save yhilpisch/e252d9f1d0a4f8306b68ff5e023fde3b to your computer and use it in GitHub Desktop.

Python for Finance Online Bootcamp

3-Day Bootcamp about Python, NumPy & pandas for Finance

Dr. Yves J. Hilpisch

CEO The Python Quants | The AI Machine

Online, May 2023

Short Link

http://bit.ly/pffbc_may_2023

GotoWebinar

https://attendee.gotowebinar.com/register/1260449774563154009

Quant Platform

https://bootcamp.pqp.io (registration)
https://base.pqp.io (login)

Slides

https://certificate.tpq.io/pffbc.pdf

Discord Server

https://discord.gg/eanaY3vfKp

Miniconda Installer

https://conda.io/en/main/miniconda.html

Docker

To install Docker see https://docs.docker.com/install/.

To run a Ubuntu-based Docker container, execute on the shell (Linux/Mac) the following:

docker run -ti -p 9999:9999 -h pffbc -v $(pwd):/root/live ubuntu:latest /bin/bash

Make sure to adjust the folder to be mounted accordingly.

Once, JupyterLab is installed, run it with the following command:

jupyter lab --allow-root --port 9999 --ip 0.0.0.0

Cloud

Use this link to get a 200 USD bonus on DigitalOcean when signing up for a new account.

Further Resources

Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#
# Simple Tick Data Client
#
import zmq
context = zmq.Context()
socket = context.socket(zmq.SUB)
socket.connect('tcp://127.0.0.1:5555')
socket.setsockopt_string(zmq.SUBSCRIBE, 'MSFT')
while True:
msg = socket.recv_string()
print(msg)
#
# Simple Tick Data Collector
#
import zmq
context = zmq.Context()
socket = context.socket(zmq.SUB)
socket.connect('tcp://127.0.0.1:5555')
socket.setsockopt_string(zmq.SUBSCRIBE, '')
raw = list()
while True:
msg = socket.recv_string()
print(msg)
symbol, price = msg.split()
raw.append((symbol, float(price)))
#
# Simple Tick Data Collector
# (using pandas DataFrame objects)
#
import zmq
import datetime
import pandas as pd
context = zmq.Context()
socket = context.socket(zmq.SUB)
socket.connect('tcp://127.0.0.1:5555')
socket.setsockopt_string(zmq.SUBSCRIBE, '')
data = pd.DataFrame()
while True:
msg = socket.recv_string()
t = datetime.datetime.now()
print(msg)
symbol, price = msg.split()
df = pd.DataFrame({'symbol': symbol, 'price': float(price)}, index=[t])
data = pd.concat((data, df))
#
# Simple Tick Data Server
#
import zmq
import time
import random
context = zmq.Context()
socket = context.socket(zmq.PUB)
socket.bind('tcp://127.0.0.1:5555')
AAPL = 100.
MSFT = 100.
while True:
if random.random() > 0.45:
AAPL += random.gauss(0, 1) / 2
msg = f'AAPL {AAPL:.3f}'
else:
MSFT += random.gauss(0, 1) / 2
msg = f'MSFT {MSFT:.3f}'
socket.send_string(msg)
print(msg)
time.sleep(random.random() * 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment