The EMA_Trailing_Stoploss_LessMagic strategy is a trading strategy implemented in Python using the freqtrade library for backtesting purposes. Here's a breakdown of what the strategy does:
It uses the Exponential Moving Average (EMA) indicator to generate signals. The strategy defines two EMAs: a shorter EMA with a time period of 3 and a longer EMA with a time period of 5.
It checks for a bullish crossover condition where the shorter EMA crosses above the longer EMA.
The strategy applies this condition to determine when to enter a long position (buy signal).
It sets a minimal return on investment (ROI) of 0.01, meaning that it aims for a 1% profit. It sets a stop loss level at -0.01, indicating a 1% loss tolerance. The strategy enables a trailing stop feature, which adjusts the stop loss level as the price moves in favor of the trade. The trailing stop is set at 0.001, meaning that the stop loss level is raised by 0.001 for every 0.001 increase in the price. The strategy operates on a 5-minute timeframe for the main data and uses a 1-hour timeframe for additional information. It implements the informative_pairs method to retrieve the whitelist of trading pairs and their corresponding informative timeframe. The do_indicators method calculates the EMAs and generates a binary signal for the crossover condition. The populate_indicators method populates the indicator values in the main and informative dataframes. If the main timeframe matches the informative timeframe, it directly applies the indicators to the dataframe. Otherwise, it merges the informative dataframe into the main dataframe and adjusts the column names. The populate_buy_trend method identifies the buy signals based on the crossover condition. The populate_sell_trend method sets the sell signal to 0, indicating that there is no specific sell condition in this strategy. Overall, this strategy aims to capture bullish trends using the EMA crossover signal and employs a trailing stop loss to protect profits.