The AwesomeMacd strategy is a trading strategy that uses the MACD (Moving Average Convergence Divergence) indicator and the Awesome Oscillator to generate buy and sell signals. Here's a breakdown of what the strategy does:
It calculates the ADX (Average Directional Index) indicator with a time period of 14 and adds it to the DataFrame. It calculates the Awesome Oscillator (AO) using the qtpylib library and adds it to the DataFrame.
It calculates the MACD (MACD Line, MACD Signal Line, and MACD Histogram) using the talib library and adds them to the DataFrame.
In the populate_buy_trend method, it generates a buy signal when the following conditions are met:
MACD is greater than 0 (indicating bullish momentum).
Awesome Oscillator is greater than 0. Previous Awesome Oscillator value was less than 0 (indicating a bullish reversal). It marks the corresponding rows in the DataFrame with a 'buy' signal. In the populate_sell_trend method, it generates a sell signal when the following conditions are met:
MACD is less than 0 (indicating bearish momentum). Awesome Oscillator is less than 0. Previous Awesome Oscillator value was greater than 0 (indicating a bearish reversal). It marks the corresponding rows in the DataFrame with a 'sell' signal. The strategy sets a minimal ROI (Return on Investment) of 0.1, which is the minimum expected profit percentage for a trade. It also sets a stop-loss of -0.25, which represents the maximum tolerable loss percentage for a trade. The strategy is designed to be used with ticker intervals of 1 hour, meaning it analyzes trading data on an hourly basis. Please note that this is a simplified explanation, and there may be additional intricacies and parameters involved in the actual implementation.