التوثيق

دليل تقني لـ CT Lab by Verida. بدون حشو — كل قسم يغطي وحدة منتج حقيقية، مع الأدوات والمعاملات وأمثلة التسلسل.

1. التثبيت

CT Lab by Verida is a desktop application (Electron). Download the installer for macOS, Windows or Linux directly from the website.

Requirements

  • OS: macOS 11+, Windows 10+, or Ubuntu 20.04+
  • RAM: 4 GB minimum (8 GB recommended for ML)
  • Disk: 500 MB for the app + series cache
  • Internet: Required to fetch market data

First run

  1. Open CT Lab by Verida. No sign-up — the app is local.
  2. Go to Data Sources and fetch a series (e.g.: BTCUSDT 15m Binance).
  3. The series is persisted at ct://series/binance/BTCUSDT/15m.
  4. Apply indicators, build pipelines, run backtests — everything is composable.

Composition principle: Each tool reads and/or writes a named series. The output of one tool is the input of the next. The system does not restrict what connects to what — it only guarantees two things: timestamp alignment (join) and as-of-T reads (no look-ahead). Whether the composition is worthwhile is your decision.

2. مصادر البيانات

CT Lab by Verida fetches OHLCV candles from two providers. Raw series are persisted locally as ct://series///.

Binance

  • Type: Crypto (Spot and USDⓈ-M Futures)
  • Timeframes: 1m, 5m, 15m, 30m, 1h, 4h, 1d, 1w
  • Real-time: Yes — WebSocket for candles, trades and book
  • Order book: Yes — aggregated book (L2) at 1s
  • Trade flow: Yes — aggregated trades at 1s
  • Deep history: Available via buscar_binance_historico
  • Symbols: Any listed pair (BTCUSDT, ETHUSDT, etc.)

Yahoo Finance

  • Type: Stocks, ETFs, indices, forex, crypto
  • Timeframes: 1m, 5m, 15m, 30m, 1h, 1d, 1wk, 1mo
  • Real-time: No — historical data only
  • Order book: No
  • Symbols: AAPL, PETR4.SA, BTC-USD, ^GSPC, etc.

CSV Import

Local OHLCV files can be imported into the cache with importar_csv. Useful for broker data or proprietary sources.

3. المؤشرات

40 classic indicators available at no cost. Each takes a series (raw or derived), computes and persists the result at ct://derived/. The output becomes input for any other tool.

Trend

SMA
Simple Moving Average
EMA
Exponential Moving Average
WMA
Weighted Moving Average
HMA
Hull Moving Average
KAMA
Kaufman Adaptive MA
PSAR
Parabolic SAR
Ichimoku
Ichimoku Cloud (9, 26, 52, 26)
ADX
Average Directional Index
Aroon
Aroon Up/Down
Trend Strength
Trend Strength Index

Momentum

RSI
Relative Strength Index
MACD
MACD (12, 26, 9)
Stochastic
Stochastic Oscillator (14, 3)
CCI
Commodity Channel Index
CMO
Chande Momentum Oscillator
TRIX
Triple-smoothed EMA ROC
TSI
True Strength Index
KST
Know Sure Thing
Coppock
Coppock Curve (14, 11, 10)
DPO
Detrended Price Oscillator
SMI
SMI Ergodic Indicator
Fisher
Fisher Transform
Awesome
Awesome Oscillator
Momentum Index
Momentum Index (10, 1)
Woodies
Woodies CCI (6, 14)
RVI
Relative Vigor Index

Volatility

ATR
Average True Range
Bollinger
Bollinger Bands (20, 2σ)
Keltner
Keltner Channel
Donchian
Donchian Channel
Price Channel
Rolling extreme channel
Envelopes
Envelopes SMA(20) ±10%
Chande-Kroll
Chande Kroll Stop

Volume

OBV
On-Balance Volume
MFI
Money Flow Index
CMF
Chaikin Money Flow
Chaikin Osc
Chaikin Oscillator (3, 10)
Klinger
Klinger Volume Oscillator
EFI
Elder's Force Index
EOM
Ease of Movement

Custom indicator recipes

Composite indicators via vectorized Rhai script. Each recipe reads a series, computes and persists the result as derived:

zscore_indicador — Z-score of any indicator (e.g.: RSI vs its mean)
distancia_media_em_atr — Distance from price to mean in ATR units
momentum_normalizado — Momentum scaled to [-1, +1] range
composto_osciladores — Weighted sum of multiple oscillators
envelope_adaptativo — Bands that adjust by volatility
razao_cross_asset — Ratio between two assets (e.g.: BTC/ETH)

4. البنية الدقيقة

Premium module. Microstructure indicators analyze the internal dynamics of the market — range, trend, intrabar strength, order flow, book pressure. Each covers a causal aspect, not a descriptive one.

CT Indicators

CT Range
Detects range from anchor candle with high volume confirmed by reversal in the following bar. Produces top, bottom and range age.
CT Trend
Causal states of the trend process after range breakout. 5 phases: impulse, retest, continuation, trap. Reference = the range itself.
CT Swing
Turn strength detector via CT BOP with dynamic calibration by empirical quantiles (Pareto 80/20). No arbitrary thresholds.
CT Candle
28 raw features per candle: direction, volatility (spread), volume, with rolling window and short window for slopes.
CT Candle Classified
Quantizes the 28 CT Candle features into 18 categorical descriptive axes (body size, wicks, regime, direction, etc.).
CT Fibo Candle
Fibonacci projection from anchor candles (largest spread + relevant volume). 30 columns: 7 levels, phases, directions and defenses.
CT Momentum
Characterizes how price exits a range by intrabar strength at the close. Measures conviction vs. absorption in the breakout bar.
CT Regime
Classifies market regime by combining amplitude, volume and movement into rolling volatility terciles.

Flow and book pressure

BFI / CT BFI
Book Flow Imbalance — bid vs. ask pressure in [-1, +1]. CT BFI is the windowed version (activity-weighted VWMA).
BOP / CT BOP
Balance of Power (Livshin) — buyer vs. seller strength intrabar in [-1, +1]. CT BOP is the volume-weighted version.
OBI / CT OBI
Order Book Imbalance — top-of-book pressure in [-1, +1]. CT OBI is the liquidity-weighted windowed version.
TFI / CT TFI
Trade Flow Imbalance — taker buy ratio in [-1, +1]. CT TFI is the volume-weighted windowed version.
DBI ±0.1% / ±1%
Depth Book Imbalance — deep version of OBI around mid at different bands.
MPO
Microprice Offset — (microprice − mid) / half_spread. Book skew in [-1, +1].

Microstructure indicators require a premium license and real-time book/trades access (Binance).

5. الخط البرمجي

The pipeline is a declarative DAG of steps. Each step applies an operation (indicator, arithmetic, comparison, transformation) over a source or over the output of a previous step. The final output is persisted as a derived series.

Available operations

Indicators

All 40 classic + 15 microstructure indicators usable as steps.

Cross-series arithmetic

add, subtract, multiply, divide between series or with a scalar.

Comparison

greater, less, greater_equal, less_equal, crosses_above, crosses_below — generates signals.

Conditional

if condition then series_A else series_B — logical branching.

Transformation

abs, neg, log, sqrt, clamp, sign — unary operations per column.

Quantile classification

Discretizes a series into N bins by rolling quantiles (adaptive ruler).

Rolling statistics

rma, smm, std_dev, linear_regression — rolling windows.

Compose

Inner-join of columns from multiple steps into a synthetic series.

Custom (Rhai)

Inline Rhai script with named inputs — total freedom.

Ready-made recipes

cruzamento_medias
Signal from crossing between two MAs (e.g.: fast EMA vs. slow EMA). Output: signal column {-1, 0, +1}.
flag_limiar_oscilador
Boolean flag when an oscillator crosses a threshold (e.g.: RSI < 30).
filtro_regime_adx
Filters signals by trend regime using ADX (e.g.: only trade if ADX > 25).
divergencia_momentum
Detects divergence between price and momentum (e.g.: price makes a high, RSI doesn't).

6. الاختبار الرجعي

The backtest takes a price series (OHLCV), a strategy in Rhai (inline or file), optional indicators, initial capital and parameters. Returns performance metrics: Sharpe, Sortino, max drawdown, win-rate, profit-factor, total PnL and number of trades. Persists results for comparison across sessions.

Strategy (Rhai)

The strategy is a Rhai script that reads price (close[0]), indicators (ind["name"][0]), current position, and returns a decision: long(), short(), flat() or decision(...).

// example: moving average crossover if ind["ema_short"][0] > ind["ema_long"][0] { long() } else if ind["ema_short"][0] < ind["ema_long"][0] { short() } else { flat() }

Experiment comparator

Define a base experiment (control) and N variants, each swapping one factor: strategy, indicators, fee_pct or parameters. Variants run side by side with everything else held fixed.

Structure measurement

ct_medir_estrutura

Measures the price path of a series: variance ratio (below 1 = anti-persistent, above 1 = persistent) and kurtosis by scale. Reports overall, by volatility tercile and by temporal blocks. Answers: is there exploitable structure in this asset, on this timeframe?

Survival test

ct_testar_sobrevivencia

The pair test. Fires N moments spaced across the chosen period. At each moment, opens long and short with the same adaptive manager (grid with stop, trailing, pyramid and breakeven). Measures the arbitrary-side floor of the doctrine: if the net sum ≥ 0 without fees, the manager survives on either side. If it doesn't survive even on long, it doesn't survive.

Don't test if your reading has edge. Test if your floor holds.

Search and persistence

All backtests are persisted with spec and metrics. Search supports filters (field, operator, value) and sorting — basis for comparing experiments across sessions: filter by Sharpe greater than 1.0 and drawdown less than 20%, for example.

7. التعلم الآلي

Premium module. The ML pipeline is a declarative DAG of components. Trains, validates and materializes the prediction as a derived series — the model becomes a live indicator, NO re-training at serving.

Backends

centroid
Centroid-based classifier
gbdt
Gradient Boosting Decision Trees
linear
Linear regression/classification
random_forest
Tree ensemble
knn
K-Nearest Neighbors
mlp
Multi-Layer Perceptron (PyTorch)
kmeans
Unsupervised clustering
isolation_forest
Anomaly detection

Pipeline components

Features

feature_set selects columns. gerar_lags creates temporal lags. features_calendario adds hour/day (sin/cos). interagir_colunas combines features (ratio, product, difference).

Targets

target_direcao classifies +1/0/-1 with dead band. target_retorno continuous regression. target_conjunto multi-label categorical. target_custom labeling via Python script.

Preprocessing

imputar (ffill, bfill, mean, median, constant). Scalers: zscore, minmax, robust, maxabs. winsorize clips outliers by quantile. reduzir_pca reduces dimensionality. selecionar_correlacao / selecionar_variancia filter features.

Validation

holdout simple temporal split. purged_kfold K-fold with embargo (prevents leakage). walk_forward expanding or rolling. custom partitioning via Python script.

Model and optimization

modelo trains with a backend. modelo_custom trains via Python script. otimizar_hiperparametros grid or random search via cross-validation.

Serving

prever materializes prediction at ct://derived/_pred. aplicar_modelo applies a trained model to a series without re-training — the model as a live indicator. avaliar computes custom metrics via Python script.

Economic evaluation

The pipeline can optionally run a ct_backtest over the materialized prediction. Default: long if pred is positive, short if pred is negative. A custom Rhai strategy can be provided.

8. العقيدة

The doctrine of CT Lab by Verida is not a strategy. It is a method to decide whether a strategy has the right to exist.

Central thesis

Before winning, learn not to lose. The future is unknowable. Indicators are features of the past. Without structure, E[P&L] = 0. Risk is derived from probability, not from preference.

The method

  1. Foundation. Measure the structure of the price path (ct_medir_estrutura). If there is no structure, there is no possible edge — any setup is an illusion.
  2. Floor. Run the survival test (ct_testar_sobrevivencia). If the manager doesn't survive even on an arbitrary side, no reading can save it.
  3. Setup. Only after the floor validates: look for a reading that beats the pair test result. If the setup doesn't beat the floor, discard.
  4. Optimization. Refine parameters, validate with walk-forward, measure robustness. No overfitting — always compare against the floor.

The pair test

N moments spaced across the period. At each moment, opens long and short with the same adaptive manager. If the net sum ≥ 0 without fees, the manager survives on either side. If it doesn't survive even on long, it doesn't survive. It's not a profitability test. It's a test of the right to exist.

Recommended flow

1. buscar_serie
2. ct_medir_estrutura
3. salvar_lib (manager)
4. ct_testar_sobrevivencia
5. decide
اقرأ العقيدة الكاملة

9. الترخيص

CT Lab by Verida has two access tiers. Everything runs locally — there is no server, no sign-up, no telemetry.

Free

  • Fetch series (Binance + Yahoo)
  • 40 classic indicators
  • Pipeline (indicator DAG)
  • Backtest with Rhai strategy
  • Experiment comparator
  • Structure measurement
  • Survival test
  • CSV import
  • Custom indicators (Rhai)

Premium

  • Everything in Free, plus:
  • ~15 microstructure indicators
  • Real-time book collection (1s)
  • Real-time trades collection (1s)
  • Flow imbalance (BFI, OBI, TFI, MPO)
  • Machine Learning (8 backends, ~40 components)
  • Apply trained model without re-training
  • Deep history (trade backfill)
  • Recurring collection tasks

How to activate

Activation is done inside the CT Lab by Verida app via payments processed by Stripe. The license is tied to the host (per machine). No auto-renewal by default — you control it.

  • Buy: comprar_premium(plan) — returns Stripe URL.
  • Cancel renewal: cancelar_assinatura — license valid until end of paid period.
  • Refund (7 days, CDC art. 49): cancelar_pagamento — full refund + immediate cancellation.