├── requirements.txt
├── .streamlit
└── config.toml
├── README.md
└── OpenBBxStreamlit.py
/requirements.txt:
--------------------------------------------------------------------------------
1 | streamlit
2 | pandas
3 | openbb==3.0.0
4 | plotly
5 |
--------------------------------------------------------------------------------
/.streamlit/config.toml:
--------------------------------------------------------------------------------
1 | [theme]
2 | primaryColor="#fdfbfb"
3 | backgroundColor="#000000"
4 | secondaryBackgroundColor="#0d0d31"
5 | textColor="#fd8000"
6 | font="monospace"
7 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # OpenBB x Streamlit [](https://openbb.streamlitapp.com/)
2 |
OVERVIEW
3 | Simple financial dashboard powered by OpenBB and Streamlit. App displays stocks, bonds, currencies, cryptos, indices, and alt economic data all in one place.
4 |
5 | CURRENT FEATURES
6 |
7 | - World Currencies, US Indices, US Bonds, Commodities
8 | - Congress latest trades,
9 | - Short Data- Highest cost to borrow, stocks with high short interest, % Float Short & Days to Cover, Dark Pool Short Positions
10 | - Economy- Inflation, CPI, GDP, Unemployment
11 |
12 | FUTURE FEATURES-(TBD)
13 |
14 | - Addition of Assest Fundemental Analysis
15 | - Addition of Technical Analysis scanner
16 | - Addition of a live newsfeed
17 |
18 |
19 | OpenBB: https://openbb.co/
20 | Streamlit: https://www.streamlit.io/
21 |
--------------------------------------------------------------------------------
/OpenBBxStreamlit.py:
--------------------------------------------------------------------------------
1 | import streamlit as st
2 | import pandas as pd
3 | from openbb_terminal.sdk import openbb
4 | openbb.keys.fred(key = '9cbe93cd8132301fd46ad5e755944df0', persist = True)
5 | TerminalStyle().applyMPLstyle()
6 | st.set_page_config(
7 | layout="wide",
8 | page_title="OpenBB X Streamlit",
9 | )
10 | hide_streamlit_style = """
11 |
15 | """
16 | st.markdown(hide_streamlit_style, unsafe_allow_html=True)
17 | st.set_option('deprecation.showPyplotGlobalUse', False)
18 | col1, col2, col3, col4 = st.columns([25,11,4,10])
19 | with col1:
20 | st.title('Dashboard Powered By')
21 | st.write('Built by [Joseph B](https://twitter.com/DirtyDefi)')
22 | with col2:
23 | st.image("https://raw.githubusercontent.com/OpenBB-finance/OpenBBTerminal/main/images/openbb_logo.png",width=120)
24 |
25 | with col3:
26 | st.markdown("""
27 |
28 | # &
29 | """)
30 |
31 | with col4:
32 | st.image("https://raw.githubusercontent.com/mesmith027/streamlit-roboflow-demo/master/images/streamlit_logo.png",width=180)
33 | with st.container():
34 | st.sidebar.write('Special thanks to the team at [Openbb](https://openbb.co/) Excited to see what the future holds as the lead the way in open source investment research!')
35 |
36 | st.sidebar.write('Feel free to reach [out](https://twitter.com/DirtyDefi) I love talking anything markets and programming.')
37 |
38 | st.sidebar.write('Please note this app is NOT financial advice. The dashboards is NOT intended to help guide financial decisions!')
39 | def color_negative_red(val):
40 | if type(val) != 'str':
41 | color = 'green' if val >0 else 'red'
42 | return f'color: {color}'
43 | col1, col2, col3 = st.columns([30,30,30])
44 | with col1:
45 | st.subheader('World Currencies')
46 | data = openbb.economy.currencies()
47 | data[['Chng']] = data[['Chng']].apply(pd.to_numeric)
48 | data[['%Chng']] = data[['%Chng']].apply(pd.to_numeric)
49 | st.dataframe(data.style.applymap(color_negative_red, subset=['Chng','%Chng']))
50 | with col2:
51 | st.subheader('US Indices')
52 | data = openbb.economy.indices()
53 | data[['Chg','%Chg']] = data[['Chg','%Chg']].apply(pd.to_numeric)
54 | st.dataframe(data.style.applymap(color_negative_red, subset=['Chg','%Chg']))
55 | with col3:
56 | st.subheader('US Bonds')
57 | data = openbb.economy.usbonds()
58 | data[data.columns[1]] = data[data.columns[1]].apply(pd.to_numeric)
59 | data[data.columns[2]] = data[data.columns[2]].apply(pd.to_numeric)
60 | data[data.columns[3]] = data[data.columns[3]].apply(pd.to_numeric)
61 | columns = data.columns[3]
62 | st.dataframe(data.style.applymap(color_negative_red, subset=[columns]))
63 | col1, col2, col3 = st.columns([30,30,30])
64 | with col1:
65 | st.subheader('Commodities')
66 | data = openbb.economy.futures()
67 | data[['Chg','%Chg']] = data[['Chg','%Chg']].apply(pd.to_numeric)
68 | st.dataframe(data.style.applymap(color_negative_red, subset=['Chg','%Chg']))
69 | with col2:
70 | st.subheader('Sectors')
71 | st.pyplot(openbb.economy.rtps_chart())
72 |
73 | with col3:
74 | st.subheader('Economic Events')
75 | st.dataframe(openbb.economy.events())
76 |
77 | st.title('Economy')
78 | col1,col2=st.columns([55,55])
79 | with col1:
80 | st.pyplot(openbb.economy.fred_chart(series_ids=['CPIAUCSL']))
81 | with col2:
82 | st.pyplot(openbb.economy.fred_chart(series_ids=['FPCPITOTLZGUSA']))
83 | col1,col2=st.columns([55,55])
84 | with col1:
85 | st.pyplot(openbb.economy.fred_chart(series_ids=['UNRATE']))
86 |
87 | with col2:
88 | st.pyplot(openbb.economy.fred_chart(series_ids=['FEDFUNDS']))
89 | st.title('Government Trading & Contracts')
90 | col1, col2=st.columns([50,50])
91 | with col1:
92 | st.subheader('Government contracts')
93 | st.dataframe(openbb.stocks.gov.lastcontracts())
94 |
95 | with col2:
96 | st.subheader('Congress Latest Trades')
97 | st.write(openbb.stocks.gov.lasttrades())
98 |
99 | col1, col2=st.columns([50,50])
100 | with col1:
101 | st.subheader('Senate Latest Trades')
102 | st.pyplot(openbb.stocks.gov.topbuys_chart(gov_type = "senate", past_transactions_months = 6))
103 |
104 | with col2:
105 | st.subheader('Senate Latest Trades')
106 | st.pyplot(openbb.stocks.gov.topsells_chart(gov_type = "senate", past_transactions_months = 6))
107 |
108 | col1, col2=st.columns([50,50])
109 | with col1:
110 | st.subheader('Congress Latest Trades')
111 | st.pyplot(openbb.stocks.gov.topbuys_chart(gov_type = "congress", past_transactions_months = 6))
112 |
113 | with col2:
114 | st.subheader('Congress Latest Trades')
115 | st.pyplot(openbb.stocks.gov.topsells_chart(gov_type = "congress", past_transactions_months = 6))
116 | st.title('Short Data')
117 | col1,col2=st.columns([35,55])
118 | with col1:
119 | st.subheader('% Float Short & Days to Cover')
120 | st.dataframe(openbb.stocks.dps.sidtc())
121 | with col2:
122 | st.subheader(' Dark Pool Short Positions')
123 | st.dataframe(openbb.stocks.dps.pos())
124 | st.title('Crypto')
125 | col1,col2=st.columns([55,55])
126 | with col1:
127 | st.subheader('Bitcoin Circulating Supply')
128 | st.pyplot(openbb.crypto.onchain.btc_supply_chart())
129 | with col2:
130 | st.subheader('Daily Bitcoin Transactions')
131 | st.pyplot(openbb.crypto.onchain.btc_transac_chart())
132 | col1,col2=st.columns([55,55])
133 | with col1:
134 | st.subheader('Altcoin Index')
135 | st.pyplot(openbb.crypto.ov.altindex_chart())
136 | with col2:
137 | st.subheader('Defi TVL')
138 | st.pyplot(openbb.crypto.defi.stvl_chart(limit=730))
139 |
140 | col1,col2=st.columns([50,50])
141 | with col1:
142 | st.subheader('Top Cryptos')
143 | st.dataframe(openbb.crypto.disc.top_coins(source="CoinGecko", limit=50))
144 | with col2:
145 | st.subheader('Crypto Hacks')
146 | st.dataframe(openbb.crypto.ov.crypto_hacks())
147 | st.subheader('Enter a ticker below to get price chart, Government Contracts, Insider Activity, and list of suppliers and customers')
148 | text_input = st.text_input('Symbol')
149 | if text_input:
150 | data = openbb.stocks.load(text_input)
151 | df_max_scaled = data.copy()
152 |
153 |
154 | col1, col2 = st.columns(2)
155 | with col1:
156 | st.subheader('Government Contracts for {}'.format(text_input))
157 | st.dataframe(openbb.stocks.gov.contracts(symbol=text_input))
158 | with col2:
159 | st.subheader('Insider Activity for {}'.format(text_input))
160 | st.dataframe(openbb.stocks.ins.act(symbol=text_input))
161 |
162 | col1, col2 = st.columns(2)
163 | with col1:
164 | st.subheader('Suppliers of {}'.format(text_input))
165 | st.dataframe(openbb.stocks.fa.supplier(symbol=text_input, limit= 50))
166 | with col2:
167 | st.subheader('Customers of {}'.format(text_input))
168 | st.dataframe(openbb.stocks.fa.customer(symbol=text_input, limit= 50))
169 |
170 | col1, col2 = st.columns(2)
171 | with col1:
172 | st.subheader('Put/Call Ratio of {}'.format(text_input))
173 | st.pyplot(openbb.stocks.options.pcr_chart(symbol=text_input))
174 | with col2:
175 | st.subheader('Vol Surface of {}'.format(text_input))
176 | st.pyplot(openbb.stocks.options.vsurf_chart(symbol=text_input))
177 |
178 | col1, col2, col3 = st.columns([30,30,30])
179 | with col1:
180 | st.write
181 | with col2:
182 | st.pyplot(openbb.stocks.gov.gtrades_chart(symbol=text_input, gov_type = 'congress'))
183 |
184 | with col3:
185 | st.pyplot(openbb.stocks.gov.gtrades_chart(symbol=text_input, gov_type = 'congress'))
186 |
--------------------------------------------------------------------------------