With Python
Dr. Yves J. Hilpisch | The Python Quants & The AI Machine
Python for Quant Finance Meetup, London, 16. November 2022
(short link to this Gist: http://bit.ly/pqf_risk)
| from __future__ import print_function, division | |
| from timeit import default_timer as timer | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from numba import njit | |
| w = 400 | |
| h = 300 |
| from pandas import * | |
| from datetime import * | |
| import pdb as pdb | |
| df = DataFrame.from_csv('aapl_1-2012_5min.csv') | |
| dayCount=0 | |
| rangeHigh = -1 | |
| rangeLow = 9999 | |
| openDayRangeDict = {} | |
| getRange = 1 |
With Python
Dr. Yves J. Hilpisch | The Python Quants & The AI Machine
Python for Quant Finance Meetup, London, 16. November 2022
(short link to this Gist: http://bit.ly/pqf_risk)
| #include <glm/matrix.hpp> | |
| class Frustum | |
| { | |
| public: | |
| Frustum() {} | |
| // m = ProjectionMatrix * ViewMatrix | |
| Frustum(glm::mat4 m); |
| #!/bin/bash | |
| ### steps #### | |
| # verify the system has a cuda-capable gpu | |
| # download and install the nvidia cuda toolkit and cudnn | |
| # setup environmental variables | |
| # verify the installation | |
| ### | |
| ### to verify your gpu is cuda enable check |
| import streamlit as st | |
| import pandas as pd | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from datetime import timedelta | |
| def generate_stock_equity(start_date, end_date): | |
| num_days = (end_date - start_date).days + 1 | |
| changes = np.random.randint(low=-150, high=150, size=num_days) |
| #%% | |
| import random | |
| import numpy as np | |
| from pymoo.core.problem import ElementwiseProblem | |
| from pymoo.algorithms.moo.nsga2 import NSGA2 | |
| from pymoo.algorithms.moo.nsga3 import NSGA3 | |
| from pymoo.optimize import minimize | |
| from pymoo.util.ref_dirs import get_reference_directions | |
| from pymoo.operators.sampling.rnd import FloatRandomSampling |