CryptoMarketParser/main_whales_watcher.py
Simon Moisy fcc0342fd8 Add whale activity plotting and alert processing to ChartView
- Introduced a new subplot for whale activity in ChartView (WIP)
- Implemented alert queue processing to handle whale alerts.
- Updated WhalesWatcher to support alert queue integration.
2025-03-25 17:00:53 +08:00

27 lines
957 B
Python

from WhalesWatcher import WhalesWatcher
from ChartView import ChartView
import threading
import queue
def start_whales_watcher(alert_queue):
whales_watcher = WhalesWatcher(alert_queue)
whales_watcher.run()
if __name__ == "__main__":
# Create a queue for passing whale alerts between threads
whale_alert_queue = queue.Queue()
# Start WhalesWatcher in a separate thread
watcher_thread = threading.Thread(target=start_whales_watcher, args=(whale_alert_queue,))
watcher_thread.daemon = True
# Start the watcher thread
watcher_thread.start()
# Define exchanges for the chart
exchange_ids = ['binance', 'kraken', 'coinbase', 'bitfinex', 'huobi', 'kucoin', 'bybit', 'okx', 'gateio', 'mexc']
# Start the chart viewer with alert queue
chart_view = ChartView(exchange_ids, alert_queue=whale_alert_queue)
# Run the GUI (this will block until the window is closed)
chart_view.start_gui()