-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.py
42 lines (34 loc) · 1.46 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from utils.setup import setup
from core.orders import OrderManager
from utils.helpers import display_leverage_info
from hyperliquid.utils import constants
from hyperliquid.exchange import Exchange
from allora.allora_mind import AlloraMind
from analysis.performance_analyzer import PerformanceAnalyzer
import time
def main():
(address, info, exchange, vault, allora_upshot_key, deepseek_api_key, check_for_trades, price_gap,
allowed_amount_per_trade, max_leverage, allora_topics) = setup()
print(address)
manager = OrderManager(exchange, vault, allowed_amount_per_trade, max_leverage, info)
allora_mind = AlloraMind(manager, allora_upshot_key, deepseek_api_key, threshold=price_gap)
allora_mind.set_topic_ids(allora_topics)
allora_mind.start_allora_trade_bot(interval=check_for_trades)
# Add periodic analysis
while True:
try:
analyze_trading_results()
time.sleep(3600) # Analyze every hour
except KeyboardInterrupt:
break
def analyze_trading_results():
analyzer = PerformanceAnalyzer()
results = analyzer.analyze_results()
print("\nTrading Analysis Results:")
print("========================")
print("\nPerformance by Market Condition:")
print(results['condition_analysis'])
print(f"\nVolatility Correlation: {results['volatility_correlation']:.4f}")
print(f"Allora Prediction Accuracy: {results['prediction_accuracy']:.4f}")
if __name__ == "__main__":
main()