GOGAby BibaMoney · Tvijo AIOS
Strategy Optimizer Manual · v2 — деда4

Strategy Optimizer: 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
Percentages are entered as percentages: 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:

ObjectiveWhat it measuresWhen to use
is_netNet profit %Maximize total return
is_expectancyAvg trade returnдеда4 default — reward per trade
sharpeReturn / volatilitySmoother equity curve
sortinoDownside-only SharpeAsymmetric risk
calmarAnnual return / max DDReward per unit of pain
profit_factorGross profit / gross lossWinners must outweigh losers
fitnessComposite score + hard gatesBalanced 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."

In the validate phase, the cap does NOT hide data — it only flags breaches (dd_cap_exceeded = true). Validate is the truth report; the gate already punishes drawdown.
Real example: A genetic run of 1357 Donchian20@1h trials on ARB + 5 coins — the 15% cap discarded ALL 1357 configs. Donchian20@1h has 57–130% account drawdown on every coin. This is a feature: on this timeframe, such a configuration does not exist. For 4h (like ATOM), chances are better.

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 best objective 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) was a falling coin — exactly the kind most traders avoid. But Donchian20 trades both directions: shorts profit on drops. A falling coin is only unprofitable for a long-only holder.

The winning configuration

Strategydonchian20 @ 4h
Stop-loss5%
Take-profit16%
Trailing stop3%
Leverage
Before (base params)−361%
After (optimized)+296%
OOS (out-of-sample)+290%

Two honest caveats

1. Noise floor not cleared. Sharpe 1.16 < noise-floor 1.41 for 144 trials → verdict PAPER_ONLY. The edge is not distinguishable from grid luck. Forward confirmation is needed — another backtest won't prove anything.
2. Parameters don't transfer. The same config on SOL/LINK/AVAX gave OOS −35%, breadth 1/3. This is curve-fitting to one coin, not a universal edge.

What we learned (EDGE Knowledge Base)

Six research notes from the ATOM campaign are seeded in the KB (bilingual, auto-translated via DeepSeek) and shown publicly on /crypto/ATOM and in the Lab:

  • Noise floor: why Sharpe must clear √(2·ln N · 365/days)
  • Parameter transfer: why one-coin winners are suspect
  • Fees: ema9_21 consumed 184% of margin on 614 trades
  • History depth: why 200+ candles is the minimum
  • "Before→After flatters — OOS is the only exam"
  • Drawdown as the honest kill criterion

User Optimizer

Available at /app/optimizer (login required, free):

  • "Check YOUR parameters" — instant backtest through the same honest engine (fees, leverage ≤5×, pessimistic fills, IS/OOS). Result: price + trades, equity before/after, Sharpe + Sortino, "✓ beats defaults / ✗ defaults win".
  • Run history ("My runs"): every run saved with parameters, IS/OOS, Sortino. A ↩ button restores parameters. Daily limit: 200 tests, fail-closed.
  • "Request full optimization" — a full search costs compute, so the request goes to the operator queue. In the admin Runs panel: "📨 User optimization requests" (▶ launched / ✕ rejected / ✓ done).

Access Tiers

TierWhat you seeWhere
AnonymousHonest teaser: verdicts, "before −361% → after +296% PAPER_ONLY", research notes, CTA "Sign in — free"/crypto/ATOM
Signed in (free)Everything: trade chart, equity, statistics, exact parameters, user optimizer/app/optimizer
AdminFull optimizer: launch jobs, genetic search, heatmap, CSV, presets, user request queue/app/admin/optimizer

EDGE Knowledge Base

The EDGE Knowledge Base turns research findings into public knowledge. A research_notes table stores bilingual notes (auto-translated via DeepSeek) that are shown on coin pages and in the Lab as "Research notes — what we learned."

Admins can add new findings with a single POST — translation is automatic. Current notes from the ATOM campaign cover: noise floor, parameter transfer, fee erosion, history depth, OOS as the only exam, and drawdown as the kill criterion.

Glossary

In-Sample (IS)the data used to tune the strategy. Fitting it looks great but proves nothing on its own.
Out-of-Sample (OOS)data the strategy never saw during tuning. The only honest test that an edge is real.
Sharpe ratioreturn per unit of volatility. Higher = smoother risk-adjusted return.
Sortino ratiolike Sharpe, but penalizes only downside volatility. Upside is good.
Max drawdownthe largest peak-to-trough equity drop. Worst-case pain, not the average.
Slippagethe difference between expected price and actual fill price. A real cost.
Genetic searchevolutionary algorithm that mutates and recombines promising parameter sets across generations.
Noise floorthe Sharpe ratio that random grid luck produces. A real edge must clear it. √(2·ln N · 365/days).
Overfita configuration that fits IS data perfectly but fails on OOS. The optimizer's job is to find configs that DON'T overfit.
Breadthhow many coins a configuration works on. 1/3 = one coin out of three. Broad edges are real; narrow ones are suspect.
Profit factorgross profit divided by gross loss. PF > 1 = profitable. PF > 2 = robust.
Calmar ratioannual return divided by max drawdown. Reward per unit of worst-case pain.
Donchian channelthe highest high and lowest low of the last N periods. Breakout = entry.
Trailing stopa stop-loss that follows price upward (for longs). Locks in profit while letting winners run.
PAPER_ONLYverdict: the edge did not clear the noise floor. Forward paper trading needed before any live consideration.