-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtrader.py
46 lines (34 loc) · 1.05 KB
/
trader.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
import streamlit as st
import yahoofuncs
from datetime import datetime
from dotenv import load_dotenv
from tabs import stock_info, trading, analysis, account_info
load_dotenv()
# Make the app wide
st.set_page_config(layout="wide")
col1, col2, col3 = st.columns(3)
with col1:
st.title("Trading Bot")
with col2:
ticker = st.text_input("Enter a ticker symbol:")
with col3:
account_type = st.selectbox("Account Type (Alpaca Only)", ["paper", "real"])
if ticker:
ticker = ticker.upper()
yanalysis = yahoofuncs.YahooAnalysis(ticker)
# Create tabs
stock_info_tab, analysis_tab, trading_tab, account_info_tab = st.tabs(
["Stock Info", "Analysis", "Trading", "Account Info"]
)
# Stock Info tab
with stock_info_tab:
stock_info.show(ticker, yanalysis)
# Analysis tab
with analysis_tab:
analysis.show(ticker, yanalysis)
# Trading tab
with trading_tab:
trading.show(ticker, yanalysis, account_type)
# Account Info tab
with account_info_tab:
account_info.show(account_type)