-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpfaction.py
37 lines (26 loc) · 1.33 KB
/
pfaction.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
import streamlit as st
import yfinance as yf
st.title("Depot status and ETF stats")
#st.title("yf vanguard all world ")
def get_ticker(shortname):
vanguard = yf.Ticker(shortname)#"#VGWL.DE")
df=(vanguard.history(period='1y', interval='1d', start=None, end=None, prepost=False, actions=True, auto_adjust=True, back_adjust=False, proxy=None, rounding=False, tz=None,).iloc[:,0:5])
return df
shares= 560.2146 #444.2184
btc = 0.01191310
submit = st.button('refresh')
if submit:
vanguard_last_close= get_ticker("VGWL.DE").iloc[-1,3]
current_stat=vanguard_last_close * shares #get_ticker("VGWL.DE").iloc[-1,3]#
#444.2184#64.9556
invested = 48836.10#500+5000+5000+27766.4
btc_last_close = get_ticker("BTC-EUR").iloc[-1,3]
st.write("BTC last close in EUR: ", btc_last_close, " BTC value: ", (btc_last_close*btc))
st.write("Vanguard FTSE all world close: ", vanguard_last_close, "no. of shares: ", shares)
st.write("Depot status: ",current_stat, " total invest: ", invested)
st.write("win / loss: ",current_stat- invested)
st.write("Performance: ",((current_stat - invested)/invested)*100)
tname = st.selectbox('Choose ticker name: ',('VWRL.MI','VGWL.DE', 'XDWD.DE','XMAW.DE'))
st.write(get_ticker(tname).iloc[-1,])
st.line_chart(get_ticker(tname)["Close"])
#st.write(float(df.iloc[0,3][0])*64.9556)