59 lines
2.0 KiB
Python
59 lines
2.0 KiB
Python
|
|
import sys
|
|
import os
|
|
import asyncio
|
|
from pathlib import Path
|
|
|
|
# Add project root to path
|
|
project_root = Path(os.getcwd())
|
|
sys.path.insert(0, str(project_root))
|
|
sys.path.insert(0, str(project_root / 'backend'))
|
|
|
|
# Mock db for simple config read if possible, or use real one
|
|
from backend.config_manager import ConfigManager
|
|
from backend.database.connection import db
|
|
|
|
async def main():
|
|
print("Initializing ConfigManager...")
|
|
# Initialize ConfigManager with account_id=1
|
|
config_manager = ConfigManager.for_account(1)
|
|
|
|
# Force load from DB
|
|
try:
|
|
config_manager.reload()
|
|
print("Config reloaded from DB.")
|
|
except Exception as e:
|
|
print(f"Error reloading config: {e}")
|
|
|
|
print("\n=== Current TRADING_CONFIG (Merged) ===")
|
|
from trading_system import config
|
|
|
|
# Manually merge DB config into trading_system.config.TRADING_CONFIG to simulate runtime
|
|
for k, v in config_manager._cache.items():
|
|
config.TRADING_CONFIG[k] = v
|
|
|
|
tp_pct = config.TRADING_CONFIG.get('TAKE_PROFIT_PERCENT')
|
|
tp1_pct = config.TRADING_CONFIG.get('TAKE_PROFIT_1_PERCENT')
|
|
|
|
print(f"TAKE_PROFIT_PERCENT: {tp_pct} (Type: {type(tp_pct)})")
|
|
print(f"TAKE_PROFIT_1_PERCENT: {tp1_pct} (Type: {type(tp1_pct)})")
|
|
|
|
print("\n=== All Take Profit Related Configs ===")
|
|
for k, v in config.TRADING_CONFIG.items():
|
|
if 'TAKE_PROFIT' in k:
|
|
print(f"{k}: {v}")
|
|
|
|
print("\n=== Risk Related Configs ===")
|
|
print(f"FIXED_RISK_PERCENT: {config.TRADING_CONFIG.get('FIXED_RISK_PERCENT')}")
|
|
print(f"SIGNAL_STRENGTH_POSITION_MULTIPLIER: {config.TRADING_CONFIG.get('SIGNAL_STRENGTH_POSITION_MULTIPLIER')}")
|
|
print(f"USE_FIXED_RISK_SIZING: {config.TRADING_CONFIG.get('USE_FIXED_RISK_SIZING')}")
|
|
|
|
# Check if there are any suspicious small values
|
|
print("\n=== Suspiciously Small Values (< 0.01) ===")
|
|
for k, v in config.TRADING_CONFIG.items():
|
|
if isinstance(v, (int, float)) and 0 < v < 0.01:
|
|
print(f"{k}: {v}")
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|