"""Buy-and-hold — always long. The asset risk premium itself, and the baseline every active strategy
must beat after costs. Cheap, real, and a deliberate benchmark in the research matrix."""
from __future__ import annotations

import numpy as np

from fxhnt.domain.models import PriceSeries
from fxhnt.domain.strategies.base import register


class BuyAndHold:
    kind = "buy_hold"
    rationale = "the asset risk premium — long-only baseline; the benchmark active strategies must beat"

    def positions(self, prices: PriceSeries, params: dict[str, float]) -> np.ndarray:
        pos = np.ones(len(prices.close))
        if len(pos):
            pos[0] = 0.0
        return pos


register(BuyAndHold())
