refactor: Simplify technical scanner results display with summary table and download option
This commit is contained in:
parent
83159566e3
commit
a24605e839
@ -64,17 +64,19 @@ def technical_scanner_page():
|
|||||||
)
|
)
|
||||||
if signals:
|
if signals:
|
||||||
st.success(f"Found {len(signals)} signals")
|
st.success(f"Found {len(signals)} signals")
|
||||||
for signal in signals:
|
# Create a summary table
|
||||||
with st.expander(f"{signal['ticker']} - ${signal['entry_price']:.2f}"):
|
summary_df = pd.DataFrame(signals)[['ticker', 'entry_price', 'target_price', 'stop_loss']]
|
||||||
col1, col2 = st.columns(2)
|
summary_df = summary_df.round(2) # Round numeric columns to 2 decimal places
|
||||||
with col1:
|
st.dataframe(summary_df)
|
||||||
st.metric("Entry Price", f"${signal['entry_price']:.2f}")
|
|
||||||
st.metric("Target", f"${signal['target_price']:.2f}")
|
# Add a download button for the full results
|
||||||
st.metric("Stop Loss", f"${signal['stop_loss']:.2f}")
|
full_df = pd.DataFrame(signals)
|
||||||
with col2:
|
st.download_button(
|
||||||
st.metric("Shares", signal['shares'])
|
label="Download Full Results",
|
||||||
st.metric("Position Size", f"${signal['position_size']:.2f}")
|
data=full_df.to_csv(index=False),
|
||||||
st.metric("Risk Amount", f"${abs(signal['risk_amount']):.2f}")
|
file_name="scanner_results.csv",
|
||||||
|
mime='text/csv'
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
st.info("No signals found")
|
st.info("No signals found")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user