Skip to content
All library documents

Long Entries from Awesome Oscillator Crosses with MACD Confirmation

Article Strategy library · Author: berlinguyinca

Summary

This hourly long-only strategy combines the Awesome Oscillator (AO) with MACD. It enters when AO crosses from negative to positive while MACD is above zero, seeking an upward momentum shift with confirmation from a second indicator. It exits when AO crosses from positive to negative while MACD is below zero, signaling a downward shift.

The source also specifies a 10% minimal return on investment target and a 25% stop loss, though these are strategy settings rather than evidence of expected performance. ADX is calculated but does not affect the entry or exit conditions. The document supplies no market, backtest period, or results, so it does not establish how the rules perform. Because both signals rely on lagging indicators, whipsaws and delayed entries or exits are possible; the listed settings should not be treated as validated risk controls.

Key ideas

  • A long entry requires AO to cross above zero while MACD is positive.
  • A long exit requires AO to cross below zero while MACD is negative.
  • ADX is calculated but is not used to filter trades.
  • The strategy lists a return target and stop loss but provides no supporting performance evidence.
  • Indicator lag may lead to late signals or whipsaws.

Tags

Full text
# AwesomeMacd


# AwesomeMacd









author@: Gert Wohlgemuth

    converted from:

    https://github.com/sthewissen/Mynt/blob/master/src/Mynt.Core/Strategies/AwesomeMacd.cs

## Source (GPL-3.0)

```python
# --- Do not remove these libs ---
from freqtrade.strategy import IStrategy
from pandas import DataFrame
import talib.abstract as ta
import freqtrade.vendor.qtpylib.indicators as qtpylib


# --------------------------------


class AwesomeMacd(IStrategy):
    """

    author@: Gert Wohlgemuth

    converted from:

    https://github.com/sthewissen/Mynt/blob/master/src/Mynt.Core/Strategies/AwesomeMacd.cs

    """

    INTERFACE_VERSION: int = 3
    # Minimal ROI designed for the strategy.
    # adjust based on market conditions. We would recommend to keep it low for quick turn arounds
    # This attribute will be overridden if the config file contains "minimal_roi"
    minimal_roi = {
        "0": 0.1
    }

    # Optimal stoploss designed for the strategy
    stoploss = -0.25

    # Optimal timeframe for the strategy
    timeframe = '1h'

    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        dataframe['adx'] = ta.ADX(dataframe, timeperiod=14)
        dataframe['ao'] = qtpylib.awesome_oscillator(dataframe)

        macd = ta.MACD(dataframe)
        dataframe['macd'] = macd['macd']
        dataframe['macdsignal'] = macd['macdsignal']
        dataframe['macdhist'] = macd['macdhist']

        return dataframe

    def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        dataframe.loc[
            (
                    (dataframe['macd'] > 0) &
                    (dataframe['ao'] > 0) &
                    (dataframe['ao'].shift() < 0)

            ),
            'enter_long'] = 1
        return dataframe

    def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        dataframe.loc[
            (
                    (dataframe['macd'] < 0) &
                    (dataframe['ao'] < 0) &
                    (dataframe['ao'].shift() > 0)

            ),
            'exit_long'] = 1
        return dataframe

```

Shown in full with attribution under the source's licence. Licence: GPL-3.0

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.