refactor: reorganize project structure into tests/, data/, logs/

- Move all backtest/simulation scripts to tests/
  - Add sys.path.insert to each script for correct import resolution
- Move pkl cache files to data/ (git-ignored)
- Move log files to logs/ (git-ignored)
- Update main.py: trading.log path → logs/trading.log
- Add ecosystem.config.js: pm2 log paths → logs/pm2*.log
- Update .gitignore: ignore data/ and logs/ instead of *.pkl/*.log
- core/fng.py: increase cache TTL 3600→86400s (API updates daily at KST 09:00)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
joungmin
2026-03-03 16:08:50 +09:00
parent bfe0b4d40c
commit 6b2c962ed8
30 changed files with 1039 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
"""공포탐욕지수(F&G) 조회 모듈.
alternative.me API로 일일 F&G 값을 가져와 메모리에 캐시한다.
캐시 TTL은 1시간 (F&G는 하루 1회 업데이트).
캐시 TTL은 24시간 (F&G는 하루 1회 KST 09:00 업데이트).
환경변수:
FNG_MIN_ENTRY (기본값 41): 이 값 미만이면 진입 차단
@@ -19,7 +19,7 @@ logger = logging.getLogger(__name__)
FNG_MIN_ENTRY = int(os.getenv("FNG_MIN_ENTRY", "41")) # 진입 허용 최소 F&G 값
_FNG_API_URL = "https://api.alternative.me/fng/?limit=1&format=json"
_CACHE_TTL = 3600 # 1시간
_CACHE_TTL = 86400 # 24시간 (API는 하루 1회 KST 09:00 업데이트)
_fng_value: int | None = None
_fng_cached_at: float = 0.0