feat(stock): exit_rules (손절·MA이탈·익절·클라이맥스)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -72,7 +72,10 @@ def _ma(closes: "pd.Series", window: int) -> Optional[float]:
|
|||||||
|
|
||||||
|
|
||||||
def exit_rules(holding: dict, ticker_prices: "pd.DataFrame", params: dict) -> dict:
|
def exit_rules(holding: dict, ticker_prices: "pd.DataFrame", params: dict) -> dict:
|
||||||
"""가격 기반 청산/리스크 flag. (momentum_loss는 compute 단계에서 합산.)"""
|
"""가격 기반 청산/리스크 flag (stop_loss/ma50_break/ma200_break/take_profit/climax).
|
||||||
|
|
||||||
|
Note: momentum_loss는 compute_and_store 단계에서 집계하므로 여기서 설정하지 않는다.
|
||||||
|
"""
|
||||||
flags = {"stop_loss": False, "ma50_break": False, "ma200_break": False,
|
flags = {"stop_loss": False, "ma50_break": False, "ma200_break": False,
|
||||||
"take_profit": False, "climax": False}
|
"take_profit": False, "climax": False}
|
||||||
avg = holding.get("avg_price")
|
avg = holding.get("avg_price")
|
||||||
|
|||||||
Reference in New Issue
Block a user