from itertools import product
from src.strategies.moving_average import MovingAverageCrossover

class MACrossoverOptimization:

    name = "MA_Crossover"

    @staticmethod
    def parameter_grid():
        fast = [10, 15, 20, 25, 30]
        slow = [40, 50, 60, 80, 100]
        min_gap = 15

        for f, s in product(fast, slow):
            if s - f >= min_gap:
                yield {
                    "fast_period": f,
                    "slow_period": s,
                    "ma_type": "ema",
                    "use_adx": False,
                }

    @staticmethod
    def build_strategy(params):
        return MovingAverageCrossover(**params)
