34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
import logging
|
|
from time import sleep
|
|
from core.data_monitor import DataMonitor
|
|
from config import API_KEY, SECRET_KEY, PASSPHRASE, SANDBOX, MONITOR_CONFIG
|
|
|
|
logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s: %(message)s')
|
|
|
|
|
|
class MonitorMain:
|
|
def __init__(self):
|
|
self.data_monitor = DataMonitor(
|
|
api_key=API_KEY,
|
|
secret_key=SECRET_KEY,
|
|
passphrase=PASSPHRASE,
|
|
sandbox=SANDBOX,
|
|
)
|
|
self.symbols = MONITOR_CONFIG.get("volume_monitor", {}).get("symbols", ["XCH-USDT"])
|
|
self.intervals = MONITOR_CONFIG.get("volume_monitor", {}).get("intervals", ["5m", "15m", "1H", "4H", "1D"])
|
|
self.initial_date = MONITOR_CONFIG.get("volume_monitor", {}).get("initial_date", "2025-07-01 00:00:00")
|
|
|
|
def initial_data(self):
|
|
for symbol in self.symbols:
|
|
for interval in self.intervals:
|
|
data = self.data_monitor.get_historical_kline_data(symbol=symbol,
|
|
start=self.initial_date,
|
|
bar=interval)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
monitor_main = MonitorMain()
|
|
monitor_main.initial_data()
|
|
|
|
|