Carles Sentis
|
de0f267fb0
Add trade lifecycle management documentation
|
3 days ago |
Carles Sentis
|
b185e1c107
Refactor InfoCommands and TradingCommands to remove deprecated auto-sync logic for orphaned positions. Updated notification handling to include trade lifecycle IDs for better tracking of orders. Enhanced MarketMonitor to utilize cached data for orders and positions, improving efficiency. Improved logging for better traceability of trade actions and notifications.
|
3 days ago |
Carles Sentis
|
ff587c2ed9
Refactor MarketMonitor to enhance external trade handling and orphaned position management. Improved logic for linking bot orders to trades, recording fills, and determining action types based on trade context. Updated entry price estimation for orphaned positions with enhanced side detection and fallback mechanisms. Enhanced logging for better traceability of trade processing and notifications.
|
3 days ago |
Carles Sentis
|
a750fec4e8
Refactor active trades command in InfoCommands to utilize open positions instead of all active trades. Updated messaging and logging for clarity, improved user notifications, and enhanced error handling. Adjusted MarketMonitor to log external position actions for better traceability.
|
3 days ago |
Carles Sentis
|
766045c215
Remove unused imports in info_commands.py to streamline code and improve readability.
|
3 days ago |
Carles Sentis
|
a80a67f780
Refactor token case normalization across commands and alarm manager - Introduced a new utility function, _normalize_token_case, to standardize token case handling in InfoCommands, ManagementCommands, TradingCommands, AlarmManager, TradingStats, and PriceFormatter. This enhancement improves consistency in token processing, particularly for mixed-case tokens, ensuring accurate command execution and alarm management.
|
3 days ago |
Carles Sentis
|
b35c45a3cc
Enhance InfoCommands and MarketMonitor with notification manager integration - Updated InfoCommands to accept a notification manager for sending alerts on auto-synced positions. Improved MarketMonitor to immediately check for orphaned positions on startup and send notifications with detailed risk metrics. Enhanced logging for better traceability of auto-sync actions and notifications.
|
3 days ago |
Carles Sentis
|
e5c105fd5b
Integrate market monitoring with trading engine for enhanced data caching - Connected MarketMonitor to TradingEngine for shared access to cached positions, orders, and balance data. Updated InfoCommands to utilize cached data for auto-syncing positions, improving efficiency and responsiveness. Enhanced logging for better traceability of data usage and cache updates.
|
4 days ago |
Carles Sentis
|
a210658664
Enhance orphaned position handling in InfoCommands and MarketMonitor - Updated logic to utilize exchange data for entry prices, improving accuracy in position management. Added detailed notifications with exchange-provided risk metrics, including unrealized P&L, leverage, and liquidation prices. Enhanced logging for better traceability of auto-sync actions and fallback mechanisms.
|
4 days ago |
Carles Sentis
|
e70404443d
Implement entry price estimation for orphaned positions - Added functionality to estimate entry prices for orphaned positions in both InfoCommands and MarketMonitor. This enhancement improves the accuracy of position management by providing fallback mechanisms for cases where the entry price is zero, including checks for recent fills, current market prices, and bid/ask averages. Enhanced logging for better traceability of the estimation process.
|
4 days ago |
Carles Sentis
|
ab63095d50
Implement auto-sync for orphaned positions in trading bot - Enhanced InfoCommands and MarketMonitor to automatically detect and sync orphaned positions without trade lifecycle records. This update improves position management accuracy and user notifications, ensuring all positions are tracked effectively. Added logging for better traceability of auto-sync actions.
|
4 days ago |
Carles Sentis
|
3d5e262812
Update stop loss activation logic in MarketMonitor - Changed the method for checking pending stop losses from active trades to the trades table, aligning with the new unified trades management approach. This update enhances the priority handling of stop loss activations, improving overall trading accuracy.
|
4 days ago |
Carles Sentis
|
3cb4cb089b
Refactor trading logic to unify position tracking and enhance command handling - Updated the trading bot to utilize a unified trades table as the single source of truth for open positions, improving accuracy in position management. Enhanced InfoCommands to provide detailed statistics on active trades and open positions, including improved error handling and user notifications. Updated TradingEngine and TradingStats to support new lifecycle management for trades, streamlining the overall trading process.
|
4 days ago |
Carles Sentis
|
75edbe2ebf
Refactor trading bot initialization and enhance command handling - Updated the TelegramTradingBot to initialize MarketMonitor with a notification manager for improved alerting. Added a new /cycles command in InfoCommands to display trade cycle statistics, enhancing user insights into trading performance. Improved error handling and logging for better traceability in command execution.
|
4 days ago |
Carles Sentis
|
ee48c1c8ac
Enhance documentation and project structure - Added a comprehensive documentation index for quick navigation and updated project structure details to reflect new data storage and enhanced stop loss management features. Improved clarity in module responsibilities and included new integration notes for unified position tracking.
|
4 days ago |
Carles Sentis
|
5321ab723d
Enhance stop loss cancellation logic in MarketMonitor - Implemented edge case handling to wait for potential fills before cancelling stop losses. Added checks for recent fills to prevent unnecessary cancellations, improving order management accuracy. Enhanced logging for better traceability of order statuses and actions taken.
|
4 days ago |
Carles Sentis
|
c31e47261d
Refactor order status update logic in TradingEngine and TradingStats - Updated the method for updating order statuses to include a new parameter for setting the exchange order ID directly. Improved logging to provide clearer feedback on order updates, enhancing overall traceability and debugging capabilities.
|
4 days ago |
Carles Sentis
|
6e7803b227
Refactor stop loss retrieval logic in InfoCommands - Enhanced the method for identifying pending stop losses by first retrieving all pending trigger orders and then filtering them based on type and parent order reference ID. Improved logging for better debugging and clarity in matching stop losses to their respective orders.
|
4 days ago |
Carles Sentis
|
14ae0d889a
Enhance stop loss order logic in TradingEngine - Implemented smart stop loss functionality to determine order type (market or limit) based on current market price relative to stop price. Improved logging for order placement and error handling, ensuring clarity in execution status and enhancing overall stop loss management.
|
4 days ago |
Carles Sentis
|
a4cee8b091
Refactor stop loss retrieval in InfoCommands - Updated the method for fetching pending stop losses to streamline the logic and improve readability. The new implementation directly filters pending stop losses by parent order reference ID, enhancing clarity in the code and maintaining consistent user notifications regarding stop loss statuses.
|
4 days ago |
Carles Sentis
|
c76ba56746
Refactor price formatting in InfoCommands and TradingCommands - Integrated the PriceFormatter for consistent price display across order and trade notifications. Updated relevant sections to utilize the formatter, enhancing clarity in user messages regarding order details and trade confirmations.
|
4 days ago |
Carles Sentis
|
cf7ab53c06
Implement price formatting utilities and integrate into trading commands - Added a new PriceFormatter class for handling price formatting with exchange-specific precision. Updated InfoCommands and TradingCommands to utilize the new formatter for displaying prices, enhancing clarity and consistency in user notifications. Initialized the formatter in TradingEngine to ensure proper integration across the application.
|
4 days ago |
Carles Sentis
|
3849a02442
Enhance stop loss management in MarketMonitor - Updated orphaned stop loss cleanup logic to consider parent order statuses, improving accuracy in identifying and cancelling orphaned stop losses. Enhanced logging to provide clearer reasons for cancellations and updated documentation for the cleanup method to reflect new behavior.
|
4 days ago |
Carles Sentis
|
2da0a71b51
Refactor MarketMonitor to enhance external trade processing - Updated the method for checking external trades to utilize the TradingEngine's recent fills retrieval. Improved timestamp handling and state management by loading the last processed trade time from the database. Enhanced logging for better debugging and added a safety net for activating pending stop losses based on recent fills, ensuring robust trade management.
|
4 days ago |
Carles Sentis
|
d0ffa6537a
Refactor trading command notifications to accommodate new response format - Updated long, short, and exit order success notifications to extract and display order details from the new response structure. Enhanced backward compatibility by creating mock order objects for notifications, ensuring consistent user feedback and improved clarity in order status messages.
|
4 days ago |
Carles Sentis
|
1e20e93542
Improve gitignore rules for data directory to ensure all data files are ignored
|
4 days ago |
Carles Sentis
|
f9395fb099
Remove data files from git tracking - should be ignored
|
4 days ago |
Carles Sentis
|
c6d9f2f62a
Add initial price alarms JSON and trading stats SQLite file - Created a new JSON file for price alarms to manage alarm states and added a SQLite database for trading statistics, enhancing data persistence and management. Updated trading commands to reflect changes in order cancellation notifications, including detailed summaries of cancelled orders.
|
4 days ago |
Carles Sentis
|
938e56a535
Refactor reset_data.sh and trading_bot.py for SQLite integration - Updated reset_data.sh to remove legacy JSON files and handle SQLite database cleanup. Modified trading_bot.py to check for SQLite database existence instead of JSON files, enhancing statistics persistence reporting. Adjusted management_commands.py to reflect the new SQLite file structure for trading stats. Improved trading_stats.py to rename order_id to exchange_fill_id and added linked_order_table_id for better data management.
|
4 days ago |
Carles Sentis
|
5ae857d2d6
Enhance order management and stop loss functionality - Updated InfoCommands to display pending stop losses linked to orders, improving user visibility. Refactored TradingCommands to ensure accurate stop loss notifications and confirmations. Transitioned MarketMonitor to utilize SQLite for state management, replacing file-based persistence, and added comprehensive logging for order status updates. Improved TradingEngine to handle order placements and cancellations more robustly, including linked stop loss management, ensuring better tracking and execution of trades.
|
4 days ago |