Skip to content
All library documents

Quickie: Short-Horizon Momentum Entries with Indicator-Based Exits

Article Strategy library · Author: berlinguyinca

Summary

Quickie is a five-minute long strategy intended to capture momentum while closing trades quickly and limiting losses. Entries require ADX above 30, a rising nine-period TEMA below the middle Bollinger Band, and the close below the 200-period SMA. Exits require ADX above 70, TEMA above the Bollinger midpoint, and TEMA turning down. The code also defines time-based return targets that become less demanding as a trade ages, along with a 25% stop loss.

The document provides entry and exit rules, indicator settings, and risk parameters, but includes no market or asset specification, backtest period, sample size, or performance results. Some details warrant scrutiny: the variable named for a 50-period SMA is calculated with a 200-period length, and the entry conditions place price below its long-term average despite the momentum framing. The broad stop and age-based targets may also produce materially different outcomes across assets and market conditions. The rules therefore describe a testable system, not evidence of profitability.

Key ideas

  • Quickie defines long entries on five-minute bars using ADX, TEMA direction, Bollinger Bands, and a long-term SMA.
  • Its exit signal requires very high ADX, TEMA above the Bollinger midpoint, and a declining TEMA.
  • The strategy sets age-based return targets and a 25% stop loss.
  • The SMA labeled as a 50-period measure is calculated using a 200-period window in the code.
  • No backtest results or tested asset are supplied, so profitability cannot be assessed from the document.

Tags

Full text
# Quickie


# Quickie









author@: Gert Wohlgemuth

    idea:
        momentum based strategie. The main idea is that it closes trades very quickly, while avoiding excessive losses. Hence a rather moderate stop loss in this case

## Source (GPL-3.0)

```python
# --- Do not remove these libs ---
from freqtrade.strategy import IStrategy
from typing import Dict, List
from functools import reduce
from pandas import DataFrame
# --------------------------------

import talib.abstract as ta
import freqtrade.vendor.qtpylib.indicators as qtpylib


class Quickie(IStrategy):
    """

    author@: Gert Wohlgemuth

    idea:
        momentum based strategie. The main idea is that it closes trades very quickly, while avoiding excessive losses. Hence a rather moderate stop loss in this case
    """

    INTERFACE_VERSION: int = 3
    # Minimal ROI designed for the strategy.
    # This attribute will be overridden if the config file contains "minimal_roi"
    minimal_roi = {
        "100": 0.01,
        "30": 0.03,
        "15": 0.06,
        "10": 0.15,
    }

    # Optimal stoploss designed for the strategy
    # This attribute will be overridden if the config file contains "stoploss"
    stoploss = -0.25

    # Optimal timeframe for the strategy
    timeframe = '5m'

    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        macd = ta.MACD(dataframe)
        dataframe['macd'] = macd['macd']
        dataframe['macdsignal'] = macd['macdsignal']
        dataframe['macdhist'] = macd['macdhist']

        dataframe['tema'] = ta.TEMA(dataframe, timeperiod=9)
        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)
        dataframe['sma_50'] = ta.SMA(dataframe, timeperiod=200)

        dataframe['adx'] = ta.ADX(dataframe)

        # required for graphing
        bollinger = qtpylib.bollinger_bands(dataframe['close'], window=20, stds=2)
        dataframe['bb_lowerband'] = bollinger['lower']
        dataframe['bb_middleband'] = bollinger['mid']
        dataframe['bb_upperband'] = bollinger['upper']

        return dataframe

    def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        dataframe.loc[
            (
                    (dataframe['adx'] > 30) &
                    (dataframe['tema'] < dataframe['bb_middleband']) &
                    (dataframe['tema'] > dataframe['tema'].shift(1)) &
                    (dataframe['sma_200'] > dataframe['close'])

            ),
            'enter_long'] = 1
        return dataframe

    def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
        dataframe.loc[
            (
                    (dataframe['adx'] > 70) &
                    (dataframe['tema'] > dataframe['bb_middleband']) &
                    (dataframe['tema'] < dataframe['tema'].shift(1))
            ),
            '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.