Xpersona
F

Freqtrade Strategy Dev

CLAWHUB · Unverified

Develop, iterate, and improve Freqtrade cryptocurrency trading strategies. Use when writing a new strategy, improving an existing one, analyzing why a strate... Skill: Freqtrade Strategy Dev Owner: djc00p Summary: Develop, iterate, and improve Freqtrade cryptocurrency trading strategies. Use when writing a new strategy, improving an existing one, analyzing why a strate... Tags: latest:1.0.4 Version history: v1.0.4 | 2026-04-06T02:12:23.412Z | user Fix: replace bare code blocks with python stoploss = -0.03 # 3% max loss per trade trailing_stop = True trailing_stop_positive =

62
Rank
84
Safety
1.0k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17akx17qd32yxnr1065qq0kdd83h2c3:freqtrade-strategy-dev
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-djc00p-freqtrade-strategy-dev/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

75,066 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: freqtrade-strategy-dev
description: "Develop, iterate, and improve Freqtrade cryptocurrency trading strategies. Use when writing a new strategy, improving an existing one, analyzing why a strategy is losing, or understanding which indicators to use. Covers strategy anatomy, key configuration parameters, proven entry/exit patterns, and the iteration workflow. Trigger phrases: write freqtrade strategy, improve strategy, why is my strategy losing, freqtrade indicators, strategy not profitable, freqtrade entry conditions."
metadata: {"clawdbot":{"emoji":"🧠","requires":{"bins":["docker","docker-compose"]},"os":["linux","darwin","win32"]}}
---

# Freqtrade Strategy Development

Build profitable trading strategies with disciplined iteration, tight risk management, and data-driven entry/exit rules. Assumes Freqtrade is running via Docker (`docker-compose`).

## Strategy Anatomy

Every Freqtrade strategy requires three methods:

- **`populate_indicators(dataframe, metadata)`** — Add technical indicators (RSI, MACD, Bollinger Bands, etc.) to the dataframe
- **`populate_entry_trend(dataframe, metadata)`** — Define buy signal logic; set `enter_long = 1` when conditions met
- **`populate_exit_trend(dataframe, metadata)`** — Define sell signal logic; set `exit_long = 1` when conditions met (optional if using ROI/stop-loss)

## Key Config Parameters

```python
stoploss = -0.03  # 3% max loss per trade
trailing_stop = True
trailing_stop_positive = 0.01
trailing_stop_positive_offset = 0.02

minimal_roi = {
    "0": 0.04,      # 4% profit target immediately
    "30": 0.02,     # 2% after 30 candles
    "60": 0.01,     # 1% after 60 candles
}

timeframe = "5m"  # or "15m", "1h", etc.
stake_currency = "USDT"
dry_run = True  # Always backtest/dry-run first
```

## Proven Entry Pattern

```python
stoploss = -0.03
trailing_stop = True
trailing_stop_positive = 0.01
trailing_stop_positive_offset = 0.02
minimal_roi = {"0": 0.04, "30": 0.02, "60": 0.01}

# In populate_indicators: calculate RSI, CCI, Bollinger Bands, EMA, Volume SMA

# In populate_entry_trend: only buy when ALL conditions met
conditions = [
    (dataframe['rsi'] < 30),  # Oversold
    (dataframe['cci'] < -100),  # Momentum confirmation
    (dataframe['close'] < dataframe['bb_lowerband']),  # Price near lower band
    (dataframe['volume'] > dataframe['volume_sma']),  # Volume confirms
    (dataframe['bullish_candle']),  # Pattern confirmation
]
dataframe.loc[reduce(lambda x, y: x & y, conditions), 'enter_long'] = 1
```

## Key Lessons Learned

1. **Tight stops save accounts** — 3% max loss beats 5%, 7%, or 8% every time
2. **Quality over quantity** — 25 selective trades outperform 308 mediocre ones
3. **Win rate alone is meaningless** — 63% win rate unprofitable if avg loss is 5x avg gain
4. **Selectivity is survival** — RSI(30) + CCI(-100) dual filters dramatically reduce noise
5. **Test in bear markets** — If strategy survives a crash, it works everywhere
6. **Volume confirms conviction** — Entr

_meta.json

{
  "ownerId": "kn75k4jwpn9qgy3pk38e93gkt982zqmg",
  "slug": "freqtrade-strategy-dev",
  "version": "1.0.4",
  "publishedAt": 1775441543412
}

references/indicators-guide.md

# Indicators Guide

Quick reference for the most effective technical indicators in Freqtrade strategy development.

## RSI (Relative Strength Index)

**Period:** 14 (standard)

**Formula:** RSI = 100 - (100 / (1 + RS)), where RS = avg gain / avg loss

**Interpretation:**
- < 30 = Oversold (potential buy)
- > 70 = Overbought (potential sell)
- 30–70 = Neutral

**Usage:** Entry filter for oversold conditions; exit filter for overbought conditions.

**In Freqtrade:**
```python
dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)
```

---

## CCI (Commodity Channel Index)

**Period:** 20 (standard)

**Formula:** CCI = (Typical Price - SMA) / (0.015 × Mean Deviation)

**Interpretation:**
- < -100 = Deep oversold; strong momentum reversal signal
- -100 to +100 = Neutral
- > +100 = Deep overbought

**Usage:** Momentum confirmation for entry signals; very selective filter.

**In Freqtrade:**
```python
dataframe['cci'] = ta.CCI(dataframe, timeperiod=20)
```

---

## Bollinger Bands

**Period:** 20; Std Dev: 2.0

**Formula:** 
- Middle Band = SMA(20)
- Upper Band = Middle + (2 × StdDev)
- Lower Band = Middle - (2 × StdDev)

**Interpretation:**
- Price near lower band = Oversold; reversal likely
- Price near upper band = Overbought; pullback likely
- Bands widening = Volatility increasing
- Bands narrowing = Consolidation

**Usage:** Identify overbought/oversold zones; confirm breakouts.

**In Freqtrade:**
```python
dataframe['bb_upperband'], dataframe['bb_middleband'], \
    dataframe['bb_lowerband'] = ta.BBANDS(dataframe, timeperiod=20)
```

---

## EMA (Exponential Moving Average)

**Period:** 9, 21, 50 (customize per timeframe)

**Formula:** EMA = (Close - EMA_prev) × (2 / (n + 1)) + EMA_prev

**Interpretation:**
- Price above EMA = Uptrend
- Price below EMA = Downtrend
- EMA slope shows trend strength

**Usage:** Trend filter; avoid counter-trend entries.

**In Freqtrade:**
```python
dataframe['ema_9'] = ta.EMA(dataframe, timeperiod=9)
dataframe['ema_21'] = ta.EMA(dataframe, timeperiod=21)
```

---

## MACD (Moving Average Convergence Divergence)

**Default:** Fast=12, Slow=26, Signal=9

**Formula:**
- MACD Line = EMA(12) - EMA(26)
- Signal Line = EMA(9) of MACD
- Histogram = MACD - Signal

**Interpretation:**
- MACD > Signal & both > 0 = Strong uptrend
- MACD < Signal & both < 0 = Strong downtrend
- Crossovers = Trend changes

**Usage:** Trend confirmation; identify momentum shifts.

**In Freqtrade:**
```python
macd, signal, hist = ta.MACD(dataframe)
dataframe['macd'] = macd
dataframe['macd_signal'] = signal
```

---

## MFI (Money Flow Index)

**Period:** 14

**Formula:** MFI = 100 - (100 / (1 + Money Flow Ratio))

**Interpretation:**
- < 20 = Oversold with volume; strong buy setup
- > 80 = Overbought with volume; strong sell setup

**Usage:** Confirm entry signals with volume weight; avoid low-volume trades.

**In Freqtrade:**
```python
dataframe['mfi'] = ta.MFI(dataframe, timeperiod=14)
```

---

## Volume SMA (Volume Simple Moving Average)

**Perio

references/iteration-workflow.md

# Strategy Iteration Workflow

Step-by-step process for developing, testing, and optimizing a profitable Freqtrade strategy.

## Phase 1: Baseline Strategy

### Step 1: Define Core Logic

Write a simple, testable strategy with:
- One clear entry condition (e.g., RSI < 30)
- One clear exit condition (e.g., RSI > 70, or ROI target)
- Tight stop-loss (3%)
- Basic position sizing

**Example:**
```python
# Entry: RSI oversold
# Exit: 4% profit target or 3% stop loss
# No filters yet; just raw signal
```

### Step 2: Set Conservative Parameters

- `stoploss = -0.03` (3%)
- `minimal_roi = {"0": 0.04}` (4% immediate target)
- `timeframe = "5m"` (shorter candles = faster feedback)
- `dry_run = True` (always)

### Step 3: Backtest 90–120 Days

```bash
freqtrade backtesting \
  --strategy MyStrategy \
  --datadir user_data/data \
  --timerange 20240101-20240331
```

**Capture these metrics:**
- Total trades
- Win rate
- Avg win / Avg loss ratio
- Sharpe ratio
- Max drawdown
- Profit %

---

## Phase 2: Analysis & Diagnosis

### Step 4: Review Exit Reasons

After backtest, analyze:

**Q: Are you exiting winners too early?**
- Increase minimal_roi targets
- Add trailing_stop to let winners run

**Q: Are you exiting losers too late?**
- Tighten stop-loss (but not below 2%)
- Add early exit condition for weak signals

**Q: Are you taking too many losing trades?**
- Add entry filters (volume, momentum, trend)
- Require multiple indicators to align

**Q: Are you trading in choppy, sideways markets?**
- Filter by trend (price above EMA)
- Require strong momentum (CCI < -100)

---

## Phase 3: Selective Iteration

### Step 5: Tighten ONE Parameter

Pick the single biggest issue from Step 4. Change ONLY that parameter.

**Example iteration path:**

**Version 1 (baseline):**
- RSI < 30 entry
- Result: 150 trades, 52% win rate, losing

**Version 2 (add RSI > 70 exit):**
- RSI < 30 entry, RSI > 70 exit
- Result: 145 trades, 55% win rate, still losing

**Version 3 (add volume filter):**
- RSI < 30 entry, volume > 20-period SMA
- Result: 65 trades, 60% win rate, +2.3% profit ✓

**Version 4 (add CCI confirmation):**
- RSI < 30 AND CCI < -100, volume > SMA
- Result: 42 trades, 64% win rate, +3.8% profit ✓

**Version 5 (tighten stop-loss):**
- Same entry logic
- Stop-loss 2% instead of 3%
- Result: 42 trades, 65% win rate, +4.1% profit ✓

### Step 6: Backtest Same Period, Compare

Run backtest on identical date range. Compare to baseline:

```text
Metric              | v1 Baseline | v3 (Volume) | v4 (CCI) | v5 (2% SL)
Total Trades        | 150         | 65          | 42       | 42
Win Rate            | 52%         | 60%         | 64%      | 65%
Avg Win / Loss      | 1.1x        | 1.4x        | 1.8x     | 1.9x
Total Profit        | -0.8%       | +2.3%       | +3.8%    | +4.1%
Max Drawdown        | -12%        | -8%         | -6%      | -5%
```

**Decision rule:**
- If profit improves & max drawdown stays acceptable → **KEEP**
- If profit improves but drawdown explodes → **RE

skill-card.md

## Description:

Develops, iterates, and improves Freqtrade cryptocurrency trading strategies with guidance for strategy anatomy, configuration, entry and exit rules, indicators, backtesting, and dry-run validation.

This skill is ready for commercial/non-commercial use.

## Publisher:

[djc00p](https://clawhub.ai/user/djc00p)

### License/Terms of Use:

MIT-0

## Use Case:

Developers and Freqtrade users use this skill to draft, diagnose, and refine cryptocurrency trading strategies through indicator selection, risk controls, backtesting, and dry-run iteration.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Trading examples may be mistaken for ready-to-run live trading advice.

Mitigation: Treat examples as educational starting points and require backtesting, dry-run validation, and human review before live use.

Risk: Generic trigger phrases may activate the skill for unrelated strategy questions.

Mitigation: Narrow activation phrases to Freqtrade-specific strategy development requests.

## Reference(s):

- [Indicators Guide](references/indicators-guide.md)
- [Strategy Iteration Workflow](references/iteration-workflow.md)
- [ClawHub Skill Page](https://clawhub.ai/djc00p/skills/freqtrade-strategy-dev)
- [Publisher Profile](https://clawhub.ai/user/djc00p)

## Skill Output:

**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance]

**Output Format:** [Markdown guidance with Python and shell command examples]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [May propose Freqtrade strategy code, configuration snippets, indicator choices, backtesting commands, and iteration checklists.]

## Skill Version(s):

1.0.4 (source: server release evidence)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to Freqtrade Strategy Dev and adjacent AI workflows.