fix: Remove duplicate number_input elements and add unique keys in watchlist form
This commit is contained in:
parent
c418973cf3
commit
73daf18fc8
@ -247,42 +247,31 @@ def trading_system_page():
|
|||||||
|
|
||||||
col1, col2 = st.columns(2)
|
col1, col2 = st.columns(2)
|
||||||
with col1:
|
with col1:
|
||||||
ticker = st.text_input("Ticker", value=str(prefill.get('ticker', '')))
|
ticker = st.text_input("Ticker", value=str(prefill.get('ticker', '')), key="watchlist_ticker")
|
||||||
entry_price = st.number_input("Entry Price",
|
entry_price = st.number_input("Entry Price",
|
||||||
value=float(prefill.get('entry_price') or 0.0),
|
value=float(prefill.get('entry_price') or 0.0),
|
||||||
min_value=0.0,
|
min_value=0.0,
|
||||||
step=0.01,
|
step=0.01,
|
||||||
format="%.2f")
|
format="%.2f",
|
||||||
|
key="watchlist_entry_price")
|
||||||
shares = st.number_input("Shares",
|
shares = st.number_input("Shares",
|
||||||
value=int(prefill.get('shares') or 0),
|
value=int(prefill.get('shares') or 0),
|
||||||
min_value=0,
|
min_value=0,
|
||||||
step=1)
|
step=1,
|
||||||
|
key="watchlist_shares")
|
||||||
with col2:
|
with col2:
|
||||||
target_price = st.number_input("Target Price",
|
target_price = st.number_input("Target Price",
|
||||||
value=float(prefill.get('target_price') or 0.0),
|
value=float(prefill.get('target_price') or 0.0),
|
||||||
min_value=0.0,
|
min_value=0.0,
|
||||||
step=0.01,
|
step=0.01,
|
||||||
format="%.2f")
|
format="%.2f",
|
||||||
|
key="watchlist_target_price")
|
||||||
stop_loss = st.number_input("Stop Loss",
|
stop_loss = st.number_input("Stop Loss",
|
||||||
value=float(prefill.get('stop_loss') or 0.0),
|
value=float(prefill.get('stop_loss') or 0.0),
|
||||||
min_value=0.0,
|
min_value=0.0,
|
||||||
step=0.01,
|
step=0.01,
|
||||||
format="%.2f")
|
format="%.2f",
|
||||||
shares = st.number_input("Shares",
|
key="watchlist_stop_loss")
|
||||||
value=prefill.get('shares', 0),
|
|
||||||
min_value=0,
|
|
||||||
step=1)
|
|
||||||
with col2:
|
|
||||||
target_price = st.number_input("Target Price",
|
|
||||||
value=prefill.get('target_price', 0.0),
|
|
||||||
min_value=0.0,
|
|
||||||
step=0.01,
|
|
||||||
format="%.2f")
|
|
||||||
stop_loss = st.number_input("Stop Loss",
|
|
||||||
value=prefill.get('stop_loss', 0.0),
|
|
||||||
min_value=0.0,
|
|
||||||
step=0.01,
|
|
||||||
format="%.2f")
|
|
||||||
|
|
||||||
notes = st.text_area("Notes")
|
notes = st.text_area("Notes")
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user