diff --git a/environment_conda.yml b/environment_conda.yml index 82286d9..d9a027a 100644 --- a/environment_conda.yml +++ b/environment_conda.yml @@ -19,6 +19,7 @@ dependencies: - jupyter - optuna - optuna-dashboard + - pathlib - streamlit-ace - git+https://github.com/hummingbot/hbot-remote-client-py.git - git+https://github.com/hummingbot/docker-manager.git diff --git a/main.py b/main.py index b9f4047..e34f8ce 100644 --- a/main.py +++ b/main.py @@ -1,19 +1,21 @@ import streamlit as st +from pathlib import Path +from page import Page -apptitle = "High Frequency Trading" -st.set_page_config(page_title=apptitle, page_icon="🦅", layout="wide") - -st.title("Welcome!") -st.write("---") -st.code("💡 The purpose of this dashboard is to provide useful information for high frequency trading traders") -st.write("") -st.write("Watch this video to understand how the dashboard works! 🦅") -c1, c2, c3 = st.columns([1, 6, 1]) -with c2: - st.video("https://youtu.be/l6PWbN2pDK8") -st.write("If you want to contribute, post your idea in #dev-channel of [hummingbot discord](https://discord.gg/CjxZtkrH)") -st.write("---") - - +class HummingbotDashboardPage(Page): + def __init__(self): + super().__init__("Hummingbot Dashboard", Path("README.md").read_text()) + def write_page(self): + super().write_page() + st.code("💡 The purpose of this dashboard is to provide useful information for high frequency trading traders") + st.write("") + st.write("Watch this video to understand how the dashboard works! 🦅") + c1, c2, c3 = st.columns([1, 6, 1]) + with c2: + st.video("https://youtu.be/l6PWbN2pDK8") + st.write("If you want to contribute, post your idea in #dev-channel of [hummingbot discord](https://discord.gg/CjxZtkrH)") +if __name__ == "__main__": + page = HummingbotDashboardPage() + page.write_page() \ No newline at end of file diff --git a/page.py b/page.py new file mode 100644 index 0000000..91d60e8 --- /dev/null +++ b/page.py @@ -0,0 +1,16 @@ +import streamlit as st + +class Page: + def __init__(self, title, description, icon="🦅", layout="wide"): + self.title = title + self.description = description + self.icon = icon + self.layout = layout + + def write_page(self): + st.set_page_config(page_title=self.title, page_icon=self.icon, layout=self.layout) + st.title(self.title) + st.write("---") + with st.expander("About This Page"): + st.write(self.description) + st.write("---")