← Back to Home
Enhanced TRIX Strategy Backtest BTC-USD 66.16% Return While Buy-and-Hold Fell 3.60%

Enhanced TRIX Strategy Backtest BTC-USD 66.16% Return While Buy-and-Hold Fell 3.60%

Want the full code behind this test? The Mega Backtrader Strategy Pack includes 500+ Backtrader-ready Python strategies, batch runners, dashboards, CSV metrics, chart exports, and documentation. You can get the full package here: Mega Backtrader Strategy Pack.

A good trend strategy does not need to trade constantly. In this BTC-USD test, the Enhanced TRIX strategy made only six closed trades, stayed selective, and still turned a $10,000 account into more than $16,600 while buy-and-hold finished negative.

The test used BTC-USD daily candles from July 27, 2024 to July 27, 2026. The benchmark was BTC buy-and-hold over the same period.

Result Value
Strategy return 66.16%
BTC buy-and-hold return -3.60%
Excess return 69.77%
Final portfolio value $16,616.48
Sharpe ratio 1.57
Max drawdown 10.19%
Closed trades 6
Open trades 0
Win rate 66.67%

Why This Strategy Matters

EnhancedTrixStrategy is a TRIX trend-following with SMA trend and slope confirmation strategy.

The important detail is selectivity. The strategy did not win by reacting to every short-term move. It waited for a TRIX crossover, required price to be on the right side of its trend filter, and checked that the SMA slope supported the trade direction.

The strategy logic is:

  1. Calculate a TRIX line and an EMA signal line.
  2. Use a 30-period SMA as the trend filter.
  3. Require SMA slope to agree with the trade direction.
  4. Enter only when TRIX crossover, trend filter, and slope all align.
  5. Exit when TRIX crosses back or price loses the SMA filter.

How The Code Works

The strategy builds TRIX and its signal line:

self.trix = bt.indicators.TRIX(self.datas[0], period=self.params.trix_period)
self.trix_signal = bt.indicators.EMA(self.trix.trix, period=self.params.trix_signal)

The trend filter and slope confirmation come from the SMA:

self.sma_filter = bt.indicators.SimpleMovingAverage(self.datas[0], period=self.params.sma_period)
self.sma_slope = self.sma_filter - self.sma_filter(-self.params.sma_slope_lookback)

A long entry requires all three pieces to agree:

long_signal_cross = self.trix_signal_cross[0] == 1.0
long_trend_filter = self.dataclose[0] > self.sma_filter[0]
long_sma_slope_confirm = self.sma_slope[0] > 0

if long_signal_cross and long_trend_filter and long_sma_slope_confirm:
    self.order = self.buy()

This is the benefit of packaging the idea as a Backtrader strategy: the indicator setup, signal rules, position management, and output metrics all run through the same repeatable research workflow.

Backtest Setup

Setting Value
Asset BTC-USD
Benchmark BTC-USD
Period 2y
Data window July 27, 2024 to July 27, 2026
Interval 1d
Starting cash $10,000.00
Final value $16,616.48
Strategy file EnhancedTrixStrategy.py
Strategy class EnhancedTrixStrategy

Performance Results

Metric Value
Starting portfolio value $10,000.00
Final portfolio value $16,616.48
Strategy return 66.16%
BTC buy-and-hold return -3.60%
Excess return vs BTC buy-hold 69.77%
Sharpe ratio 1.57
Max drawdown 10.19%
Total trades 6
Closed trades 6
Open trades 0
Winning trades 4
Losing trades 2
Win rate 66.67%
Runtime 2.30 seconds

The run ended with no open trade, so the trade count and final equity are fully closed-position results.

Equity Curve vs Benchmark

EnhancedTrixStrategy BTC-USD equity curve versus benchmark

The equity curve shows whether the strategy built its return steadily or relied on one isolated jump. Here the comparison is especially useful because BTC buy-and-hold finished negative while the strategy finished strongly positive.

Drawdown vs Benchmark

EnhancedTrixStrategy BTC-USD drawdown versus benchmark

The drawdown chart shows how much pain the strategy had to absorb during the test. Return alone is not enough; a publishable strategy review needs the drawdown path next to the benchmark.

Rolling Return vs Benchmark

EnhancedTrixStrategy BTC-USD rolling return versus benchmark

The rolling return chart shows when the strategy gained or lost its edge. This helps separate one lucky ending from a result that developed across the test window.

Daily Return Distribution

EnhancedTrixStrategy BTC-USD daily returns histogram

The daily return distribution excludes zero-return strategy days. In this run, 602 flat strategy-equity days were removed, leaving 128 non-zero strategy return days plotted.

What Traders Can Learn From This Test

The main lesson is not that one backtest is automatically tradable. The lesson is that the research workflow matters. A useful strategy package should let you move from idea, to code, to batch test, to metrics, to charts, to publishable research without rebuilding the same infrastructure over and over.

That is exactly what the Mega Backtrader Strategy Pack is designed to do. It gives you hundreds of ready-to-run strategy modules plus the tooling to test them across assets and time windows.

Get the full package here: Mega Backtrader Strategy Pack.

Disclaimer

This article is for research and educational use only. Backtest results are not financial advice, investment advice, or a guarantee of future performance. Always validate strategy logic, data quality, execution assumptions, costs, slippage, and risk before using any trading system.