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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#%% | |
import warnings | |
warnings.filterwarnings("ignore") | |
def action_with_warnings(): | |
warnings.warn("should not appear") | |
with warnings.catch_warnings(record=True): | |
action_with_warnings() | |
import sys | |
sys.path.insert(0, '.') | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import array | |
import random | |
import json | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from math import sqrt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#%% | |
import random | |
import numpy as np | |
#%% | |
#%% | |
def calculate_fitness(individual_chromosome): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#%% | |
import warnings | |
warnings.filterwarnings("ignore") | |
def action_with_warnings(): | |
warnings.warn("should not appear") | |
with warnings.catch_warnings(record=True): | |
action_with_warnings() | |
import sys | |
sys.path.insert(0, '.') | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#%% | |
# References: | |
# - https://github.com/sammchardy/python-binance/issues/868 | |
# | |
#%% | |
from __future__ import annotations | |
from abc import ABC, abstractmethod | |
from socket import timeout | |
from typing import List |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from numba import jit | |
from numba import float64 | |
from numba import int64 | |
@jit((float64[:], int64), nopython=True, nogil=True) | |
def _ewma(arr_in, window): | |
r"""Exponentialy weighted moving average specified by a decay ``window`` | |
to provide better adjustments for small windows via: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import pandas as pd | |
import datetime as dt | |
from sklearn.datasets import make_classification | |
def create_price_data(start_price: float = 1000.00, mu: float = .0, var: float = 1.0, n_samples: int = 1000000): | |
i = np.random.normal(mu, var, n_samples) | |
df0 = pd.date_range(periods=n_samples, freq=pd.tseries.offsets.Minute(), end=dt.datetime.today()) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://pastebin.com/jgr4ZBVK | |
#https://www.reddit.com/r/algotrading/comments/p4flbp/can_i_make_tick_volume_and_dollar_bars_from_ohlc/ | |
class VolumeBarAggregator(): | |
class NumpyWrapper(): | |
def __init__(self, length): | |
self.arr = np.array(dtype=float, ) | |
def __init__(self): |