# source: https://raw.githubusercontent.com/kingdemond434-cpu/quant/cc0392e251165ce472db8cfba1d33fb83046f65e/desks/mt5/tests/fixtures/cell_emitter/synthetic_freqtrade_ema.py
# directory_url: https://github.com/kingdemond434-cpu/quant/blob/master/desks/mt5/tests/fixtures/cell_emitter/
# User: kingdemond434-cpu
# Repository: quant
# --------------------# SYNTHETIC FIXTURE -- written for desks/mt5/tests/test_cell_emitter.py, not recorded from any site.
# Shaped like a freqtrade strategy: exchange-native ground, so it may map ONLY onto crypto CFDs.
from freqtrade.strategy import IStrategy
import talib.abstract as ta
import freqtrade.vendor.qtpylib.indicators as qtpylib


class Github_kingdemond434_cpu_quant__synthetic_freqtrade_ema__20261031_170805(IStrategy):
    timeframe = '1h'
    pairs = ["ETH/USDT", "SOL/USDT"]

    def populate_indicators(self, dataframe, metadata):
        dataframe['ema_fast'] = ta.EMA(dataframe, timeperiod=9)
        dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=30)
        return dataframe

    def populate_entry_trend(self, dataframe, metadata):
        dataframe.loc[qtpylib.crossed_above(dataframe['ema_fast'], dataframe['ema_slow']),
                      'enter_long'] = 1
        return dataframe
