Files
mt5-ai-xauusd-trader/scripts/verify_allocator_reporting.py
LeoGitHubtriqbitgoogle-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
c6668af65b docs: improve developer onboarding and contribution experience (#1446)
* docs: improve developer onboarding and contribution experience

- Harden DX domain: format and fix 35+ files in scripts/ and migrations/.
- Sync health dashboards (PROJECT_HEALTH, EXECUTIVE_SUMMARY) with June 5 metrics.
- Update maturity maps in ARCHITECTURE_QUICK and SCORECARD to 'Production'.
- Reduce total repo lint debt from 146 to 33.

Co-authored-by: triqbit <242833443+triqbit@users.noreply.github.com>

* docs: improve developer onboarding and contribution experience

- Harden DX domain: format and fix 25+ files in scripts/ and utility modules.
- Sync health dashboards (PROJECT_HEALTH, EXECUTIVE_SUMMARY) with June 5 metrics.
- Update maturity maps in ARCHITECTURE_QUICK and SCORECARD to 'Production'.
- Ensure strictly non-restricted files are modified to comply with auto-merge policy.

Co-authored-by: triqbit <242833443+triqbit@users.noreply.github.com>

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: triqbit <242833443+triqbit@users.noreply.github.com>
2026-05-30 13:14:09 +00:00

52 lines
1.4 KiB
Python

import os
import sys
# Add src to path
sys.path.append(os.getcwd())
from src.research.reporting import AllocationSection
from src.trading.capital_allocator import CapitalAllocator, StrategyConfig
def verify_reporting():
allocator = CapitalAllocator(total_budget=100000.0)
s1 = StrategyConfig(
strategy_id="s1",
symbol="XAUUSD",
model_family="RL",
capital_cap=50000.0,
performance_multiplier=1.2,
)
allocator.add_strategy(s1)
allocator.update_allocation("s1", 20000.0)
# Trigger some rejections
allocator.request_allocation("unknown", 0.01)
section = allocator.to_report_section()
print(f"Section type: {type(section)}")
assert isinstance(section, AllocationSection)
print(f"Total Heat: {section.total_heat_pct}%")
assert section.total_heat_pct == 20.0
print(f"Allocations count: {len(section.allocations)}")
assert len(section.allocations) == 1
assert section.allocations[0].name == "s1"
assert section.allocations[0].multiplier == 1.2
print(f"Rejection summary: {section.rejection_summary}")
assert section.rejection_summary["STRATEGY_NOT_FOUND"] == 1
print("Reporting integration verified successfully!")
if __name__ == "__main__":
try:
verify_reporting()
except Exception as e:
print(f"Verification failed: {e}")
sys.exit(1)