# source: https://raw.githubusercontent.com/thaodo2512/fre-scan/8e0a52044543897ef0fc92f9437b5aad070fd450/user_data/strategies/sample_strategy.py
from pandas import DataFrame

from freqtrade.strategy import IStrategy


class Github_thaodo2512_fre_scan__sample_strategy__20250930_014449(IStrategy):
    """
    Minimal strategy for bootstrapping.
    - Uses 5m timeframe
    - Long-only, does not enter trades by default
    Replace conditions with your real logic.
    """

    timeframe = "5m"
    can_short = False

    # Minimal ROI (time: profit) mapping
    minimal_roi = {
        "0": 0.02,  # 2% target
    }

    stoploss = -0.05  # -5%
    trailing_stop = False

    use_exit_signal = True
    exit_profit_only = False
    ignore_buying_expired_candle_after = 0

    startup_candle_count = 20

    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        # Add indicators here if needed.
        return dataframe

    # New-style API (Freqtrade 2023+)
    def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        dataframe["enter_long"] = 0
        return dataframe

    def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        dataframe["exit_long"] = 0
        return dataframe

    # Legacy API (kept for compatibility with older versions)
    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        dataframe["buy"] = 0
        return dataframe

    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        dataframe["sell"] = 0
        return dataframe
