Files
executor/test_baa.py

70 lines
1.7 KiB
Python

#!/usr/bin/env python
"""BAA 전략 테스트 스크립트"""
from strategies.implementations import BoldAssetAllocation
import json
def test_simulation_mode():
"""시뮬레이션 모드 테스트"""
print("=" * 80)
print("시뮬레이션 모드 테스트 (BAA-G12)")
print("=" * 80)
strategy = BoldAssetAllocation()
result = strategy.execute({
"initial_capital": 100000,
"variant": "BAA-G12",
"use_real_data": False
})
print(json.dumps(result, indent=2, ensure_ascii=False))
print()
def test_real_data_mode():
"""실제 데이터 모드 테스트"""
print("=" * 80)
print("실제 데이터 모드 테스트 (BAA-G4)")
print("=" * 80)
strategy = BoldAssetAllocation()
result = strategy.execute({
"initial_capital": 50000, # $50,000
"variant": "BAA-G4",
"use_real_data": True,
"as_of_date": None, # 현재 날짜
})
print(json.dumps(result, indent=2, ensure_ascii=False))
print()
def test_specific_date():
"""특정 날짜 기준 테스트"""
print("=" * 80)
print("특정 날짜 기준 테스트 (2024-01-31)")
print("=" * 80)
strategy = BoldAssetAllocation()
result = strategy.execute({
"initial_capital": 100000,
"variant": "BAA-G12",
"use_real_data": True,
"as_of_date": "2024-01-31",
})
print(json.dumps(result, indent=2, ensure_ascii=False))
print()
if __name__ == "__main__":
# 시뮬레이션 모드 테스트
test_simulation_mode()
# 실제 데이터 모드 테스트
print("\n실제 데이터 다운로드 중... (시간이 걸릴 수 있습니다)\n")
test_real_data_mode()
# 특정 날짜 테스트
test_specific_date()