Chaikin Money Flow Sign Changes for Long Entries and Exits
Summary
This example strategy uses the Chaikin Money Flow indicator, calculated over 21 periods, to drive long-only signals on a five-minute timeframe. It marks a long entry when CMF is below zero and an exit when CMF is above zero. The configuration also sets a 1% minimal return on investment and a 5% stop loss.
The source provides implementation logic but no market, asset, backtest window, or performance evidence. It does not explain why the zero line should predict an entry or exit, nor does it describe position sizing, transaction costs, or short trades. The approach is therefore best read as a compact indicator-rule example rather than evidence of a tested trading edge.
Key ideas
- The strategy calculates Chaikin Money Flow over 21 periods.
- A CMF reading below zero triggers a long entry, while a reading above zero triggers an exit.
- The example specifies a five-minute timeframe, a 1% minimal return target, and a 5% stop loss.
- No asset, backtest results, or evidence of profitability is provided.
Tags
Full text
# TechnicalExampleStrategy
# TechnicalExampleStrategy
## Source (GPL-3.0)
```python
from pandas import DataFrame
from technical.indicators import cmf
from freqtrade.strategy import IStrategy
class TechnicalExampleStrategy(IStrategy):
INTERFACE_VERSION: int = 3
minimal_roi = {
"0": 0.01
}
stoploss = -0.05
# Optimal timeframe for the strategy
timeframe = '5m'
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe['cmf'] = cmf(dataframe, 21)
return dataframe
def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe.loc[
(
(
(dataframe['cmf'] < 0)
)
),
'enter_long'] = 1
return dataframe
def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
# different strategy used for sell points, due to be able to duplicate it to 100%
dataframe.loc[
(
(dataframe['cmf'] > 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.