UniversalMACD
Tested 1 Jun 2023 – 30 May 2025
Rank 5 of 27 by return
UniversalMACD turned $1,000 into $1,747 (+74.7%) over 729 days, while holding Bitcoin returned +288.1% and an equal mix of the ten coins +194.8%. Its worst drawdown was a relatively contained 7.2%. It won 77% of trades with small targets; a profit factor of 3.91 shows how thin that edge is.
How UniversalMACD trades
UniversalMACD replaces the usual MACD difference with a ratio (EMA12 / EMA26 − 1) so the signal means the same thing on every coin regardless of price. It buys when that ratio sits in a narrow tuned band just below zero. Its tuned sell band has a lower bound above its upper bound, so the exit signal can never fire; trades close through the stepped take-profit or the stoploss.
Normalising MACD is a sound idea, and the result here is one of the smoothest equity curves in the test. But the entry band is very narrow and the exit is effectively the ROI table alone, so small parameter changes can produce very different results.
Rules at a glance
- Indicators
- EMA 12 / 26 ratio
- Take-profit (minimal ROI)
- 21.3% from entry; 9.9% after 27m; 3% after 1h 0m; 0% after 2h 44m
- Stoploss
- −31.8%
- Trailing stop
- Off
- Exit signal
- Used
Results by month
Profit or loss in USDT for trades closed in each month.
Results by coin
| Pair | Trades | Win rate | Profit (USDT) | Avg. hold |
|---|---|---|---|---|
| XRP/USDT | 49 | 83.7% | +156.90 | 4h 5m |
| DOT/USDT | 36 | 88.9% | +130.63 | 1d 16h |
| SOL/USDT | 48 | 72.9% | +125.13 | 13h 42m |
| LINK/USDT | 48 | 70.8% | +100.23 | 1d 7h |
| AVAX/USDT | 67 | 77.6% | +89.74 | 1d 16h |
| DOGE/USDT | 67 | 74.6% | +81.45 | 21h 7m |
| ETH/USDT | 18 | 88.9% | +44.53 | 7h 53m |
| BNB/USDT | 7 | 85.7% | +17.17 | 29d 5h |
| BTC/USDT | 4 | 75.0% | +12.53 | 1h 55m |
| ADA/USDT | 53 | 71.7% | −10.95 | 1d 15h |
Why trades closed
| Exit reason | Trades | Win rate | Profit (USDT) |
|---|---|---|---|
| Take-profit (ROI) | 393 | 78.1% | +1,003.02 |
| Stoploss | 4 | 0.0% | −255.65 |
The code
UniversalMACD comes from the community freqtrade-strategies repository (GPL-3.0). These are the parts that decide when it trades; the full file is 113 lines.
Entry rules
def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: dataframe.loc[ ( (dataframe['umacd'].between(self.buy_umacd_min.value, self.buy_umacd_max.value)) ), 'enter_long'] = 1 return dataframe
Exit rules
def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: dataframe.loc[ ( (dataframe['umacd'].between(self.sell_umacd_min.value, self.sell_umacd_max.value)) ), 'exit_long'] = 1 return dataframe
Indicators
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: dataframe['ma12'] = ta.EMA(dataframe, timeperiod=12) dataframe['ma26'] = ta.EMA(dataframe, timeperiod=26) dataframe['umacd'] = (dataframe['ma12'] / dataframe['ma26']) - 1 # Just for show user the min and max of indicator in different coins to set inside hyperoptable variables.cuz # in different timeframes should change the min and max in hyperoptable variables. # print(dataframe['umacd'].min(), dataframe['umacd'].max()) return dataframe
Reproduce this test
With freqtrade installed (see our Docker guide), download the data and run the same backtest:
freqtrade download-data --exchange binance --pairs ADA/USDT AVAX/USDT BNB/USDT BTC/USDT DOGE/USDT DOT/USDT ETH/USDT LINK/USDT SOL/USDT XRP/USDT --timeframes 5m --timerange 20230501-20250530
freqtrade backtesting --strategy UniversalMACD --timeframe 5m \
--timerange 20230601-20250530 --dry-run-wallet 1000 --stake-amount 200 --max-open-trades 5 --fee 0.001
Results can differ slightly with a different data source or freqtrade version. See how we test.