- 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.
27 lines
957 B
Python
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() |