3-Day Online Bootcamp about Python & AI for Algorithmic Trading
Dr. Yves J. Hilpisch
Director CPF Program | CEO The Python Quants
Online, November 13-15, 2024
Lecture 1: Introduction to Research — [📝Lecture Notebooks] [
Lecture 2: Introduction to Python — [📝Lecture Notebooks] [
Lecture 3: Introduction to NumPy — [📝Lecture Notebooks] [
Lecture 4: Introduction to pandas — [📝Lecture Notebooks] [
Lecture 5: Plotting Data — [📝Lecture Notebooks] [[
This GraphGist will begin to explore how stock option data can be modeled as a graph, some simple Cypher queries for calculating payout at expiration for an options contract and a very basic look at finding profitable options trades given a specific forecast. Please note that some of the concepts here have been simplified and are only meant as an educational overview of exploring Neo4j and graph data modeling.
D = reconstruct(s, dim = 22 * 2 + 5, tau = 1) | |
Xs = [] | |
Ys = [] | |
for choice in np.repeat("random",3): | |
X = D[:,:22 * 2] ; Y = D[:,-5:] | |
if choice == 'random': | |
import random | |
y = [] | |
for i in range(len(Y)): |
# expects a numpy array with trades | |
# each trade is composed of: [time, price, quantity] | |
def generate_tickbars(ticks, frequency=1000): | |
times = ticks[:,0] | |
prices = ticks[:,1] | |
volumes = ticks[:,2] | |
res = np.zeros(shape=(len(range(frequency, len(prices), frequency)), 6)) | |
it = 0 | |
for i in range(frequency, len(prices), frequency): | |
res[it][0] = times[i-1] # time |