INNER CODE UNIT · Python

render_risk_output

alex-jb/orallexa-ai-trading-agent · app.py:141

def render_risk_output(risk_out):
    """Render RiskOutput inside the decision section."""
    if not risk_out.approved:
        st.warning(f"Trade not approved: {risk_out.rejection_reason}")
        return

    col1, col2, col3 = st.columns(3)
    with col1:
        st.metric("Position Size",  f"{risk_out.position_size:.2f} shares")
        st.metric("Position Value", f"${risk_out.position_value:,.2f}")
    with col2:
        st.metric("Stop Loss",      f"${risk_out.stop_loss_price:.2f}")
        st.metric("Take Profit",    f"${risk_out.take_profit_price:.2f}")
    with col3:
        st.metric("Risk Amount",    f"${risk_out.risk_amount:.2f}")
        st.metric("Risk/Reward",    f"{risk_out.risk_reward_ratio:.1f}:1")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…