-
Notifications
You must be signed in to change notification settings - Fork 0
/
Crypto_Info.py
80 lines (65 loc) · 2.06 KB
/
Crypto_Info.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import pandas as pd # pip install pandas openpyxl
import plotly.express as px # pip install plotly-express
from plotly.subplots import make_subplots
import streamlit as st # pip install streamlit
import subprocess
from config import *
from common.price_metric import *
from common.refresh_button import *
columns_to_display = [
CFG_STR_CMC_SYMBOL,
CFG_STR_CMC_NAME,
CFG_STR_BUY,
CFG_STR_STRATERGAY_TIER,
CFG_STR_BUY_MINIMAL_PERC_DROP,
CFG_STR_BUY_OPTIMAL_PERC_DROP,
#CFG_STR_BUY_GENERATIONAL_PERC_DROP,
CFG_STR_BUY_60X_PERC_DROP,
CFG_STR_BUY_MINIMAL,
CFG_STR_BUY_OPTIMAL,
#CFG_STR_BUY_GENERATIONAL,
CFG_STR_BUY_60X,
CFG_STR_CMC_PRICE]
# emojis: https://www.webfx.com/tools/emoji-cheat-sheet/
st.set_page_config(page_title="Crypto Dashboard", page_icon=":bar_chart:", layout="wide")
# ---- READ EXCEL ----
#@st.cache
def get_data_from_excel():
df = pd.read_excel(
io="data.xlsx",
engine="openpyxl",
sheet_name="Sheet1",
skiprows=0,
usecols="A:BD",
nrows=100,
)
# Add 'hour' column to dataframe
#df["hour"] = pd.to_datetime(df["Time"], format="%H:%M:%S").dt.hour
return df
def get_data_from_csv(filename):
df = pd.read_csv(filename)
return df
df_w = get_data_from_csv(CFG_FILE_WATCHLIST_OUTPUT)
df_p = get_data_from_csv(CFG_FILE_PROTFOLIO_OUTPUT)
st.session_state['df'] = df_w
st.session_state['df_p'] = df_p
st.sidebar.image("misc/suppoman.png", use_column_width=True)
display_coin_container(df_w)
display_data_refresh_button()
# ---- SIDEBAR ----# Add a button to the sidebar
st.sidebar.header("Please Filter Here:")
risk = st.sidebar.multiselect(
"Select the Risk:",
options=df_w["Risk"].unique(),
default=df_w["Risk"].unique()
)
focus = st.sidebar.multiselect(
"Select the Focus List:",
options=df_w["Focus List"].unique(),
default=1
)
df_selection = df_w.query(
"Risk == @risk"
#"Risk == @risk & 'Strategy Tier' ==@stratergy & 'Focus List' == @focus"
)
st.dataframe(df_selection)