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
def test(a): | |
assert a == 1 | |
return "It Worked!!" | |
def soma(): | |
return 2+2 |
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
# importing libraries | |
import matplotlib.pyplot as plt | |
import plotly.graph_objs as go | |
import datetime as dt | |
import seaborn as sns | |
import pandas as pd | |
import numpy as np | |
import statsmodels.api as sm | |
from IPython.display import Markdown, display |
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 yfinance as yf | |
data = yf.download("^GSPC", start="1970-01-01", end="2030-04-30")[['Open', 'High', 'Low', 'Close']] | |
data['Change (%)'] = data['Close'].pct_change() * 100 | |
data["Yesterday close - Today's Low (%)"] = (((data['Close'].shift() / data['Low']) - 1) * 100) * -1 | |
data['Range (High-Low) (%)'] = ((data['High'] / data['Low']) - 1) * 100 | |
data = data.sort_values('Range (High-Low) (%)', ascending=False) |
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 investpy | |
IWDA = investpy.get_etf_historical_data(etf='iShares Core MSCI World UCITS', | |
from_date='01/01/2000', | |
to_date='01/01/2023', | |
country='netherlands')[['Close']] | |
IWDA.columns=['Price'] | |
IWDA_daily_ret = IWDA.pct_change().dropna() * 100 |
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 yfinance as yf | |
import pandas as pd | |
data = yf.download("^GSPC", start="1971-02-26", end="2021-02-26", | |
group_by="ticker")[['Adj Close']] | |
data.columns=['S&P 500'] | |
change = data.pct_change().dropna() |
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
#%% | |
# Optimized for use in VS Code | |
# importing libraries | |
import matplotlib.pyplot as plt | |
import plotly.graph_objs as go | |
import plotly.offline as py | |
import cufflinks as cf | |
import seaborn as sns | |
import pandas as pd | |
import numpy as np |
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
from pandas_datareader import data as pdr | |
import matplotlib.pyplot as plt | |
import yfinance as yf | |
import seaborn as sns | |
import pandas as pd | |
import numpy as np | |
import calendar | |
pd.options.display.max_rows = 999 |