The EMAsStochastic strategy is a work in progress backtesting strategy designed for trading on the 1-hour timeframe. It uses a combination of exponential moving averages (EMAs) and the stochastic oscillator to generate buy and sell signals. The strategy has several configurable parameters that can be adjusted to customize its behavior.
These parameters include the lengths of three EMAs (first_ema_length, second_ema_length, third_ema_length), the maximum number of open hours for a trade (max_open_hours), and others.
The buy signal is generated when the following conditions are met:
There is trading volume.
The first EMA is greater than the second EMA, and the second EMA is greater than the third EMA. The fast %K line of the stochastic oscillator crosses above the slow %D line. The sell signal is generated when the fast %K line of the stochastic oscillator crosses below the slow %D line. The strategy also incorporates a minimal ROI table, a trailing stop feature, and a custom stop-loss function. The custom stop-loss function manages losing trades and opens room for potentially better trades by setting a stop-loss level based on the maximum open hours and current profit. The strategy uses technical indicators provided by the freqtrade library, including TA-Lib (ta) and qtpylib, to calculate the EMAs and stochastic oscillator values. Please note that the strategy is a work in progress, and it is recommended to use it at your own risk.