Diamond
Tested 1 Jun 2023 – 30 May 2025
Rank 14 of 27 by return
Diamond turned $1,000 into $837 (−16.3%) over 729 days, while holding Bitcoin returned +288.1% and an equal mix of the ten coins +194.8%. Its worst drawdown was 27.4%, a substantial dip to sit through. With a 67% win rate and a profit factor of 0.75, losses outweighed gains.
How Diamond trades
Diamond was produced by hyperparameter optimisation rather than designed by hand. Its tuned entry compares the candle high from seven bars ago with the current volume multiplied by 0.942, and its exit compares an older high with the current low. A stepped take-profit and a trailing stop do the rest.
Comparing a price to a volume figure has no market logic behind it; the rule exists because it fitted past data. Treat Diamond as an example of what over-fitted strategies look like, not as a trading idea.
Rules at a glance
- Indicators
- Shifted price vs. volume comparison
- Take-profit (minimal ROI)
- 24.2% from entry; 4.4% after 13m; 2% after 51m; 0% after 2h 50m
- Stoploss
- −27.1%
- Trailing stop
- Trails 1.1% behind the high once profit passes 5.4%
- 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 |
|---|---|---|---|---|
| LINK/USDT | 3 | 33.3% | +2.15 | 8h 47m |
| AVAX/USDT | 7 | 57.1% | +0.44 | 3d 23h |
| BTC/USDT | 0 | 0.0% | 0.00 | 0:00 |
| XRP/USDT | 0 | 0.0% | 0.00 | 0:00 |
| ADA/USDT | 0 | 0.0% | 0.00 | 0:00 |
| DOGE/USDT | 0 | 0.0% | 0.00 | 0:00 |
| DOT/USDT | 0 | 0.0% | 0.00 | 0:00 |
| SOL/USDT | 1 | 0.0% | −0.03 | 6h 10m |
| BNB/USDT | 311 | 69.5% | −22.50 | 1d 21h |
| ETH/USDT | 392 | 66.1% | −142.92 | 1d 18h |
Why trades closed
| Exit reason | Trades | Win rate | Profit (USDT) |
|---|---|---|---|
| Take-profit (ROI) | 700 | 68.6% | +500.11 |
| Still open at end of test | 2 | 0.0% | −14.56 |
| Stoploss | 2 | 0.0% | −109.07 |
| Trailing stop | 10 | 0.0% | −539.36 |
The code
Diamond comes from the community freqtrade-strategies repository (GPL-3.0). These are the parts that decide when it trades; the full file is 155 lines.
Entry rules
def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: conditions = [] conditions.append( qtpylib.crossed_above ( dataframe[self.buy_fast_key.value].shift(self.buy_horizontal_push.value), dataframe[self.buy_slow_key.value] * self.buy_vertical_push.value ) ) if conditions: dataframe.loc[ reduce(lambda x, y: x & y, conditions), 'enter_long']=1 return dataframe
Exit rules
def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: conditions = [] conditions.append( qtpylib.crossed_below ( dataframe[self.sell_fast_key.value].shift(self.sell_horizontal_push.value), dataframe[self.sell_slow_key.value] * self.sell_vertical_push.value ) ) if conditions: dataframe.loc[ reduce(lambda x, y: x & y, conditions), 'exit_long']=1 return dataframe
Indicators
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: # you can add new indicators and enable them inside # hyperoptable categorical params on the top # dataframe['ma_fast'] = ta.SMA(dataframe, timeperiod=9) # dataframe['ma_slow'] = ta.SMA(dataframe, timeperiod=18) # dataframe['{...}'] = ta.{...}(dataframe, timeperiod={...}) 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 Diamond --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.