Skip to content

Instantly share code, notes, and snippets.

View sharavsambuu's full-sized avatar
🐌

sharavsambuu sharavsambuu

🐌
View GitHub Profile
@sharavsambuu
sharavsambuu / OpenDayRangeSP500
Created May 12, 2024 15:27 — forked from 18182324/OpenDayRangeSP500
Opening Range Breakout OHLC [Python]
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Risk Parity & Budgeting

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)

@sharavsambuu
sharavsambuu / FrustumCull.h
Created September 7, 2023 16:51 — forked from podgorskiy/FrustumCull.h
Ready to use frustum culling code. Depends only on GLM. The input is only bounding box and ProjectionView matrix. Based on Inigo Quilez's code.
#include <glm/matrix.hpp>
class Frustum
{
public:
Frustum() {}
// m = ProjectionMatrix * ViewMatrix
Frustum(glm::mat4 m);
@sharavsambuu
sharavsambuu / cuda_11.8_installation_on_Ubuntu_22.04
Created August 29, 2023 08:05 — forked from MihailCosmin/cuda_11.8_installation_on_Ubuntu_22.04
Instructions for CUDA v11.8 and cuDNN 8.7 installation on Ubuntu 22.04 for PyTorch 2.0.0
#!/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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sharavsambuu
sharavsambuu / pair-trade.ipynb
Created August 7, 2023 07:10 — forked from sharavsambuunev/pair-trade.ipynb
Pair Trade in Zipline
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sharavsambuu
sharavsambuu / walk_forward_streamlit_template.py
Last active July 17, 2023 20:46
Streamlit template for Walk Forward stuffs.
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
#%%
import random
import numpy as np
from pymoo.core.problem import ElementwiseProblem
from pymoo.algorithms.moo.nsga2 import NSGA2
from pymoo.optimize import minimize
from pymoo.operators.sampling.rnd import FloatRandomSampling
from pymoo.operators.crossover.sbx import SBX
from pymoo.operators.mutation.pm import PM