diff --git a/src/bot.rs b/src/bot.rs index 00ef3e9..72b7fc8 100644 --- a/src/bot.rs +++ b/src/bot.rs @@ -238,10 +238,10 @@ impl TradingBot { }; let portfolio_value: f64 = account.portfolio_value.parse().unwrap_or(0.0); - let buying_power: f64 = account.buying_power.parse().unwrap_or(0.0); + let cash: f64 = account.cash.parse().unwrap_or(0.0); let max_allocation = portfolio_value * MAX_POSITION_SIZE; - let available_funds = buying_power - (portfolio_value * MIN_CASH_RESERVE); + let available_funds = cash - (portfolio_value * MIN_CASH_RESERVE); if available_funds <= 0.0 { return 0;