This file contains hidden or 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 datetime as dt | |
import warnings | |
import talib | |
import pandas as pd | |
import time | |
from yahoo_fin import stock_info as si | |
from scipy.stats import zscore | |
import numpy as np |
This file contains hidden or 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
prices = df['Adj Close'].tolist() | |
first_price = prices[0] | |
new_col = [current_price, current_price, current_price, current_price, current_price, current_price] | |
if hold > 0: | |
holding = [['Buy and Hold', hold, 1, first_price, np.nan, hold, np.nan, hold, np.nan, np.inf, 1]] | |
else: | |
holding = [['Buy and Hold', hold, 1, first_price, np.nan, np.nan, hold, np.nan, hold, 0, 0]] |
This file contains hidden or 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
for signal in signals: | |
if signal.lower() == 'moving average': | |
print ('-'*60) | |
print ('Simple Moving Average: ') | |
# Let's calulate Simple Moving Average(SMA) | |
short_sma= 20 | |
long_sma = 50 | |
SMAs=[short_sma, long_sma] | |
for i in SMAs: |
This file contains hidden or 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 datetime as dt | |
import matplotlib.pyplot as plt | |
import mplfinance as mpf | |
from finta import TA | |
from pylab import rcParams | |
from yahoo_fin import stock_info as si | |
import talib |
This file contains hidden or 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 datetime as dt | |
import matplotlib.pyplot as plt | |
import mplfinance as mpf | |
from finta import TA | |
from pylab import rcParams | |
from yahoo_fin import stock_info as si | |
import talib |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title>TradeView - Balance Sheet</title> | |
<script src="sort-table.js"></script> | |
<link rel="stylesheet" href="sort-table.css"> | |
<link rel="stylesheet" href="https://unpkg.com/[email protected]/build/pure-min.css" integrity="sha384-cg6SkqEOCV1NbJoCu11+bm0NvBRc8IYLRGXkmNrqUBfTjmMYwNKPWBTIKyw9mHNJ" crossorigin="anonymous"> |
This file contains hidden or 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 requests | |
import yahoo_fin.stock_info as si | |
from flask import render_template | |
def get_balance_sheet(ticker): | |
try: | |
def get_symbol(symbol): | |
url = "http://d.yimg.com/autoc.finance.yahoo.com/autoc?query={}®ion=1&lang=en".format(symbol) | |
result = requests.get(url).json() | |
for x in result['ResultSet']['Result']: |
This file contains hidden or 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 streamlit as st | |
import datetime | |
import talib | |
import ta | |
import pandas as pd | |
import requests | |
yf.pdr_override() | |
st.write(""" |
This file contains hidden or 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
# Adjusted Close Price | |
st.header(f"Adjusted Close Price\n {company_name}") | |
st.line_chart(data['Adj Close']) | |
# ## SMA and EMA | |
#Simple Moving Average | |
data['SMA'] = talib.SMA(data['Adj Close'], timeperiod = 20) | |
# Exponential Moving Average | |
data['EMA'] = talib.EMA(data['Adj Close'], timeperiod = 20) |
This file contains hidden or 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
st.write(""" | |
# Technical Analysis Web Application | |
Shown below are the **Moving Average Crossovers**, **Bollinger Bands**, **MACD's**, **Commodity Channel Indexes**, and **Relative Strength Indexes** of any stock! | |
""") | |
st.sidebar.header('User Input Parameters') | |
today = datetime.date.today() | |
def user_input_features(): | |
ticker = st.sidebar.text_input("Ticker", 'AAPL') |