The SMAOG strategy is a trading strategy that utilizes simple moving averages (SMA) and exponential moving averages (EMA) to generate buy and sell signals. Here is a breakdown of what the strategy does:
The strategy uses the SMA and EMA indicators from the TA-Lib library to calculate moving averages. It has several parameters that can be optimized, such as the number of candles to consider for buying and selling, offsets for the moving averages, thresholds for identifying bad pairs, etc.
The strategy operates on 5-minute timeframe data.
It includes a stop-loss parameter set to -0.09, which means that if the price drops by 9% from the entry point, the trade will be automatically exited.
It has a minimal return on investment (ROI) defined, where a minimum gain of 0.6 is expected before selling. The strategy uses a trailing stop, meaning that if the price increases by a certain percentage (trailing_stop_positive), the stop-loss level is adjusted to a positive offset (trailing_stop_positive_offset). The strategy does not use sell signals but relies on predefined conditions for selling, such as the price crossing above the sell moving average, certain patterns in the RSI indicator, and volume requirements. The strategy takes into account the run mode, distinguishing between hyperoptimization and regular trading, and adjusts the indicator calculations accordingly. The populate_indicators() function calculates various indicators and assigns them to the input dataframe. The populate_buy_trend() function determines the buy signals based on specific conditions, such as the price being above certain moving averages, the pair not being considered bad, and the volume being positive. The populate_sell_trend() function determines the sell signals based on conditions like the price being above the sell moving average, certain patterns in the RSI indicator, and volume requirements. Overall, the SMAOG strategy aims to generate buy signals when specific moving average and price conditions are met, and sell signals when the price reaches predefined levels or certain patterns occur in the RSI indicator.