Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import numpy as np | |
import pandas as pd | |
import yfinance as yf | |
import matplotlib.pyplot as plt | |
def heat_smooth( | |
ts: np.array, | |
h: float, | |
k: float, |
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 yfinance as yf | |
from dtaidistance import dtw | |
from plotly import graph_objects as go | |
from plotly.subplots import make_subplots | |
import plotly.io as pio | |
pio.renderers.default='svg' |
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 time | |
import numpy as np | |
import numba as nb | |
import pandas as pd | |
import yfinance as yf | |
import plotly.graph_objects as go | |
import plotly.io as pio | |
pio.renderers.default='svg' |
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 scipy.optimize import minimize, LinearConstraint | |
def find_grad_intercept(case, x, y): | |
''' | |
Find the granient and intercept terms for the envelope trend line. | |
Note: case = 'above' or 'below' | |
''' | |
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 yfinance as yf | |
import scipy.stats as stats | |
from scipy.integrate import quad | |
from scipy.optimize import minimize | |
# Get the monthly price data for the SPY ticker | |
df = yf.download( | |
'SPY', | |
interval='1mo', |
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 streamlit as st | |
import streamlit.components.v1 as components | |
st.set_page_config(layout="wide") | |
def get_info_widget( | |
ticker: str = "AAPL", | |
theme: str = "dark", | |
): | |
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 pandas as pd | |
import yfinance as yf | |
GROWTH_SINCE = '2021-12-01' # The lower date to calculate the stock performance | |
GROUPBY_COL = 'GICS Sector' # Use 'GICS Sector' or 'GICS Sub-Industry' | |
S_AND_P_URL = 'https://en.wikipedia.org/wiki/List_of_S%26P_500_companies' | |
NUM_PER_GROUP = 3 # The top n winning stocks per group | |
if __name__ == '__main__': |
NewerOlder