Стратегия Оптимизатор: the honest parameter search.
A complete guide to the GOGA Strategy Optimizer — how it searches, what it rejects, and how to read the results. For admins, traders, and curious users. No profit promises, no financial advice.
Educational content. The optimizer runs backtests on historical data — past performance does not guarantee future results. Nothing here is financial advice.
What is the Optimizer?
The Strategy Optimizer is a parameter-search engine for crypto trading strategies. It takes a strategy (like Donchian channels, EMA crossover, RSI reversal), a universe of coins, and a grid or genetic search space — then runs thousands of backtests to find configurations that survive honest testing.
Key principle: the optimizer never lies. It models fees, slippage, leverage, and splits data into In-Sample (IS) for tuning and Out-of-Sample (OOS) for validation. A configuration that looks great on IS but fails on OOS is overfit — and the optimizer tells you so.
деда4 Preset
The деда4 preset button (⚡ in the admin optimizer) sets the search axes to the exact specification from the деда4 requirements:
- Stop-loss: 0.5% → 1.5%, step 0.03%
- Take-profit: 0.5% → 5%, step 0.03%
- Slippage: 10 bps per side (0.1%)
- Max DD cap: 15% (discard)
- Objective: mathematical expectation (avg trade return)
- Mode: genetic, host = niko2
0.5 means 0.5%, not 0.005. This matches how traders think, not how code stores fractions.Slippage Input
The Slippage (bps/side) input controls how much price slippage is modeled per trade side. Default: 10 bps = 0.1% per side, matching деда4. An empty field preserves legacy behavior — old jobs are not repriced.
Slippage is a real cost. A strategy that looks profitable at 0 slippage may be unprofitable at 10 bps. The optimizer applies it symmetrically to entry and exit, in both realistic and plain modes.
Fitness Functions
The optimizer can rank trials by several fitness objectives. Choose the one that matches your goal:
| Цель | What it measures | When to use |
|---|---|---|
is_net | Net profit % | Maximize total return |
is_expectancy | Avg trade return | деда4 default — reward per trade |
sharpe | Return / volatility | Smoother equity curve |
sortino | Downside-only Sharpe | Asymmetric risk |
calmar | Annual return / max DD | Reward per unit of pain |
profit_factor | Gross profit / gross loss | Winners must outweigh losers |
fitness | Composite score + hard gates | Balanced default |
Sortino and expectancy are now written to trail columns (both IS and OOS), visible in the results table and CSV export.
Max DD Cap (discard)
The Max DD % (discard) input sets a hard cap on account drawdown. Default: 15%. A coin whose IS drawdown exceeds the cap is failed and discarded — its trial gets objective = NULL and can never be a winner. This is the деда4 rule: "iterations that don't pass are thrown away."
dd_cap_exceeded = true). Validate is the truth report; the gate already punishes drawdown.Strategy Parameter Optimization
Beyond exit parameters (stop, target, trail), the optimizer can search entry parameters — the strategy's own periods and thresholds. The launch form pulls the catalog from the strategy registry (60 strategies) and draws Start/Step/Stop rows for the selected strategy's parameters:
- Donchian:
n(channel period) - EMA crossover:
e_fast,e_slow - RSI reversal:
rsi_period,rsi_lo,rsi_hi
The gene carries these as e_fast etc. The Before→After equity chart honestly recomputes the signal with the new parameters. Verified: e_fast=5 produced 79 trades vs 38 for the base config — a real change, not a cosmetic overlay.
2D Heatmap & CSV Export
In the job detail view, two TradingView-style conveniences are available:
- 2D parameter heatmap: two X/Y selectors let you pick any two varying parameters. Each cell shows the лучшая цель across all other params. Discarded (DD-capped) trials are excluded. Green plateaus beat lone bright cells — a smooth green region means the edge is robust.
- CSV export: download all trials (search + validate) with every column — objective, IS/OOS metrics, sortino, expectancy, gene JSON, gate verdict, noise flag. For offline analysis in Excel or Python.
MACD & RSI Indicator Panels
Below the Z-Score panel, MACD and RSI chips show the same math the backtests trade with — _ema / _rsi functions, honest warmup gaps, and a live data tail from Gate.io. These are not decorative indicators; they are the actual signals the strategies use.
By design, Z-Score + MACD/RSI are also available on the user optimizer at /app/optimizer (via login-gated proxy /app/api/*).
Case Study: ATOM
The setup
ATOM (Cosmos) была падающей монетой — именно той, которой большинство трейдеров избегает. Но Donchian20 торгует в обоих направлениях: шорты зарабатывают на падениях. Падающая монета убыточна только для держателя длинных позиций.
Выигрышная конфигурация
| Стратегия | donchian20 @ 4h |
| Стоп-лосс | 5% |
| Тейк-профит | 16% |
| Трейлинг-стоп | 3% |
| Кредитное плечо | 3× |
| До (базовые параметры) | −361% |
| После (оптимизированные) | +296% |
| OOS (вне выборки) | +290% |
Два честных предостережения
Что мы узнали (База знаний EDGE)
Шесть исследовательских заметок из кампании ATOM добавлены в БЗ (двуязычные, авто-переведены через DeepSeek) и публично показаны на /crypto/ATOM и в Лаборатории:
- Шумовой порог: почему Sharpe должен превышать √(2·ln N · 365/дни)
- Перенос параметров: почему победители на одной монете подозрительны
- Комиссии: ema9_21 потребила 184% маржи на 614 сделках
- Глубина истории: почему минимум 200+ свечей
- "До→После льстит — OOS единственный экзамен"
- Просадка как честный критерий убийства
User Optimizer
Доступно на /app/optimizer (требуется вход, бесплатно):
- "ПРОВЕРЬТЕ СВОИ ПАРАМЕТРЫ" — мгновенный бэктест через тот же честный движок (комиссии, плечо ≤5×, пессимистичные исполнения, IS/OOS). Результат: цена + сделки, эквити до/после, Sharpe + Sortino, "✓ бьет дефолты / ✗ дефолты побеждают".
- История запусков ("Мои запуски"): каждый запуск сохранен с параметрами, IS/OOS, Sortino. Кнопка ↩ восстанавливает параметры. Дневной лимит: 200 тестов, закрытие при превышении.
- "Запросить полную оптимизацию" — полный поиск требует вычислений, поэтому запрос отправляется в очередь оператора. В панели администратора Runs: "📨 Запросы пользователей на оптимизацию" (▶ запущено / ✕ отклонено / ✓ выполнено).
Уровни доступа
| Уровень | Что вы видите | Где |
|---|---|---|
| Анонимный | Честный тизер: вердикты, "до −361% → после +296% PAPER_ONLY", исследовательские заметки, CTA "Войдите — бесплатно" | /crypto/ATOM |
| Авторизованный (бесплатно) | Всё: график сделок, эквити, статистика, точные параметры, пользовательский оптимизатор | /app/optimizer |
| Администратор | Полный оптимизатор: запуск задач, генетический поиск, тепловая карта, CSV, пресеты, очередь запросов пользователей | /app/admin/optimizer |
База знаний EDGE
The База знаний EDGE превращает результаты исследований в общедоступные знания. Таблица research_notes хранит двуязычные заметки (авто-переведенные через DeepSeek), которые показываются на страницах монет и в Лаборатории как "Исследовательские заметки — что мы узнали".
Администраторы могут добавлять новые находки одним POST — перевод автоматический. Текущие заметки из кампании ATOM охватывают: шумовой порог, перенос параметров, эрозию комиссий, глубину истории, OOS как единственный экзамен и просадку как критерий убийства.