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