Learn-skills.dev aicoin-freqtrade
This skill should be used when the user asks about writing trading strategies, backtesting, deploying Freqtrade bots, quantitative trading, strategy optimization, or any Freqtrade-related operation. Use when user says: 'write strategy', 'create strategy', 'backtest', 'deploy Freqtrade', 'deploy bot', 'quantitative trading', 'strategy optimization', 'hyperopt', 'live trading bot', '写策略', '创建策略', '回测', '部署Freqtrade', '部署机器人', '量化交易', '量化策略', '策略优化', '超参数优化', '实盘机器人'. IMPORTANT: ALWAYS use create_strategy to generate strategy files. NEVER write Python strategy code by hand. For crypto prices/charts, use aicoin-market. For exchange trading, use aicoin-trading. For Hyperliquid, use aicoin-hyperliquid.
git clone https://github.com/NeverSight/learn-skills.dev
T=$(mktemp -d) && git clone --depth=1 https://github.com/NeverSight/learn-skills.dev "$T" && mkdir -p ~/.claude/skills && cp -r "$T/data/skills-md/aicoincom/coinos-skills/aicoin-freqtrade" ~/.claude/skills/neversight-learn-skills-dev-aicoin-freqtrade-4a0e74 && rm -rf "$T"
data/skills-md/aicoincom/coinos-skills/aicoin-freqtrade/SKILL.mdAiCoin Freqtrade
Freqtrade strategy creation, backtesting, and deployment powered by AiCoin Open API.
Version: 1.0.0
STRATEGY CREATION — USE create_strategy
You MUST use
to generate strategy files. NEVER write Python strategy code by hand.create_strategy
# Generate a strategy with AiCoin data node scripts/ft-deploy.mjs create_strategy '{"name":"MyStrategy","timeframe":"15m","aicoin_data":["funding_rate","ls_ratio"],"description":"资金费率极端做反向"}' # Generate a pure technical strategy (no AiCoin data) node scripts/ft-deploy.mjs create_strategy '{"name":"SimpleRSI","timeframe":"1h"}'
options (combine any):aicoin_data
| Data source | What it does | AiCoin tier |
|---|---|---|
| Extreme funding = over-leveraged, trade against | Basic ($29/mo) |
| Contrarian signal from retail long/short ratio | Basic ($29/mo) |
| Whale buy/sell pressure from institutional orders | Standard ($79/mo) |
| Detect OI spikes = fragile market | Professional ($699/mo) |
| Liquidation cascade direction bias | Advanced ($299/mo) |
Strategy Generation Rules for Agent
All
aicoin_data options require a paid API key. Based on the user's strategy description:
- If strategy needs AiCoin data (
,funding_rate
,ls_ratio
,big_orders
,open_interest
):liquidation_map- Do NOT silently include it. First inform the user that this data requires a paid API key.
- Tell them which tier is needed (see table above).
- Guide them: get API key at https://www.aicoin.com/opendata → add
&AICOIN_ACCESS_KEY_ID
toAICOIN_ACCESS_SECRET
..env - Only include the paid data after user confirms they have the key configured.
- If strategy does NOT need AiCoin data: Generate a pure technical indicator strategy (RSI, EMA, Bollinger, etc.) — works for everyone out of the box.
After generating, backtest immediately:
node scripts/ft-deploy.mjs backtest '{"strategy":"MyStrategy","timeframe":"15m","timerange":"20250101-20260301"}'
Critical Rules
- ALWAYS use
to write strategies. NEVER hand-write Python strategy files.create_strategy - ALWAYS use
for backtesting. NEVER write custom Python backtest scripts.ft-deploy.mjs backtest - ALWAYS use
for deployment. NEVER use Docker. NEVER manually runft-deploy.mjs deploy
commands.freqtrade - NEVER manually edit Freqtrade config files. Use
actions.ft-deploy.mjs - NEVER manually run
,freqtrade trade
, orsource .venv/bin/activate
.pip install freqtrade
Quick Reference
| Task | Command |
|---|---|
| Create strategy | |
| Backtest | |
| Deploy (dry-run) | |
| Deploy (live) | |
| Hyperopt | |
| Strategy list | |
| Bot status | |
| Bot logs | |
| Check profit | |
| Open trades | |
Setup
Prerequisites: Python 3.11+ and git.
Environment Variables
.env auto-loaded from (first found wins):
- Current working directory
~/.openclaw/workspace/.env~/.openclaw/.env
Exchange keys (required for live/dry-run trading):
# Same format as aicoin-trading skill BINANCE_API_KEY=xxx BINANCE_API_SECRET=xxx # Or OKX, Bybit, etc. — see aicoin-trading skill for full list
AiCoin API key (required if strategy uses
aicoin_data):
AICOIN_ACCESS_KEY_ID=your-key-id AICOIN_ACCESS_SECRET=your-secret
Get at https://www.aicoin.com/opendata. See Paid Feature Guide for tier details.
安全说明: AiCoin API Key 仅用于获取市场数据,无法进行任何交易操作。交易所 API Key 需单独到交易所申请。所有密钥仅保存在本地设备
.env 文件中,不会上传到任何服务器。
Deploy
Deploy is one command:
node scripts/ft-deploy.mjs check # Check prerequisites node scripts/ft-deploy.mjs deploy '{"pairs":["BTC/USDT:USDT","ETH/USDT:USDT"]}'
This automatically: clones Freqtrade, runs
setup.sh -i, creates config from .env, starts background process, writes FREQTRADE_* vars to .env.
Deploy defaults to dry-run (simulated trading). Pass
{"dry_run":false} for live.
Scripts
scripts/ft-deploy.mjs — Deployment & Strategy
| Action | Description | Params |
|---|---|---|
| Check prerequisites | None |
| Deploy Freqtrade | |
| Run backtest | |
| Parameter optimization | |
| Generate strategy file | |
| List strategies | None |
| Update Freqtrade | None |
| Process status | None |
| Start process | None |
| Stop process | None |
| View logs | |
| Remove process | None |
scripts/ft.mjs — Bot Control (requires running process)
| Action | Description | Params |
|---|---|---|
| Health check | None |
| Start trading | None |
| Stop trading | None |
| Reload config | None |
| View config | None |
| Version info | None |
| System info | None |
| Health status | None |
| View logs | |
| Account balance | None |
| Open trades | None |
| Trade count | None |
| Trade by ID | |
| Trade history | |
| Manual entry | |
| Manual exit | |
| Cancel order | |
| Delete record | |
| Profit summary | None |
| Profit per pair | None |
| Daily report | |
| Weekly report | |
| Monthly report | |
| Statistics | None |
scripts/ft-dev.mjs — Dev Tools (requires running process)
| Action | Description | Params |
|---|---|---|
| Start backtest | |
| Backtest status | None |
| Abort backtest | None |
| Backtest history | None |
| History result | |
| Live candles | |
| Candles with indicators | |
| Available pairs | None |
| Whitelist | None |
| Blacklist | None |
| Add to blacklist | |
| Trade locks | None |
| Strategy list | None |
| Strategy detail | |
Built-in AiCoin Strategies
Auto-installed on deploy:
- FundingRateStrategy — Exploit extreme funding rates for mean reversion (Basic tier)
- WhaleFollowStrategy — Follow whale order flow + contrarian L/S ratio (Standard tier)
- LiquidationHunterStrategy — Profit from liquidation cascades (Advanced tier)
User Journey
"帮我写一个资金费率策略" → node scripts/ft-deploy.mjs create_strategy '{"name":"FundingStrat","timeframe":"15m","aicoin_data":["funding_rate"]}' "回测一下" → node scripts/ft-deploy.mjs backtest '{"strategy":"FundingStrat","timeframe":"15m","timerange":"20250101-20260301"}' "不错,部署" → node scripts/ft-deploy.mjs deploy '{"pairs":["BTC/USDT:USDT"]}' "上实盘" → node scripts/ft-deploy.mjs deploy '{"dry_run":false}' "今天赚了多少?" → node scripts/ft.mjs profit
Cross-Skill References
| Need | Use |
|---|---|
| Prices, K-lines, market data | aicoin-market |
| Exchange trading (buy/sell) | aicoin-trading |
| Hyperliquid whale tracking | aicoin-hyperliquid |
Common Errors
— Paid AiCoin feature. Do NOT retry. See Paid Feature Guide below.errorCode 304 / HTTP 403
— Need Python 3.11+.Python not found
validates this.ft-deploy.mjs check
— CheckStrategy not found
. File must be inft-deploy.mjs strategy_list
.~/.freqtrade/user_data/strategies/
— UseTimerange format
(e.g.,YYYYMMDD-YYYYMMDD
).20250101-20260301
— Freqtrade ops may take 5+ min. UseTimeout
which handles timeouts.ft-deploy.mjs
Paid Feature Guide
When a script returns 304 or 403: Do NOT retry. Tell the user:
- What happened: This AiCoin data feature needs a paid API subscription.
- How to get a key: Visit https://www.aicoin.com/opendata to register and create an API key.
- Tier options (for
in strategies):aicoin_data
| Tier | Price | Strategy Data |
|---|---|---|
| Free | $0 | Pure technical indicators only (no ) |
| Basic | $29/mo | + , |
| Standard | $79/mo | + |
| Advanced | $299/mo | + |
| Professional | $699/mo | + |
- How to configure: Add to
file:.env
AICOIN_ACCESS_KEY_ID=your-key-id AICOIN_ACCESS_SECRET=your-secret
auto-loaded from: cwd →.env
→~/.openclaw/workspace/.env
. After configuring, the same script command will work.~/.openclaw/.env- MUST tell the user: AiCoin API Key 仅用于获取市场数据,无法进行任何交易操作。如需在交易所下单,需要单独到交易所申请交易 API Key。所有密钥仅保存在你的本地设备
文件中,不会上传到任何服务器。.env
Troubleshooting
- Check Python:
(need 3.11+)python3 --version - Check logs:
node scripts/ft-deploy.mjs logs - Verify exchange keys in
(see Setup).env - DO NOT try manual fixes — report error, let ft-deploy.mjs handle it