You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add comprehensive loss detection logging to trader bot
- Enhanced GetMinimumSellPrice() with loss detection warnings when MinimumProfitSteps < 0
- Added profit/loss logging when placing sell orders to detect loss scenarios
- Added early sell loss detection with clear warnings when selling at top bid results in loss
- Added price change loss detection when sell order prices are adjusted downward
- Added realized profit/loss tracking in UpdateCashBalance() for executed sell trades
- All loss scenarios now logged with LogWarning level for easy detection and investigation
- Profit scenarios logged with LogInformation level for comparison
- Each log message includes source price, target price, actual loss/profit amount, and lot quantity
This allows careful investigation of loss reasons as requested in issue #200.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
Logger.LogWarning($"Loss detection: EARLY SELL at LOSS. Source price: {sourcePrice}, top bid price: {topBid}, actual loss: {Math.Abs(earlySellProfitLoss)}, lots: {activeSellOrder.LotsRequested}");
Logger.LogWarning($"Loss detection: PRICE CHANGE to LOSS position. Source price: {sourcePrice}, new target price: {targetSellPrice}, actual loss: {Math.Abs(priceChangeProfitLoss)}, lots: {activeSellOrder.LotsRequested}");
0 commit comments