Related:
- SETUP.md — Installation and MT5 connection
- CLI.md — CLI usage patterns and output formats
- SAMPLE-TRADE.md — Guided workflow (start here if new)
This walkthrough shows a practical “research loop”: discover methods, fetch data, add context (indicators/denoise), generate forecasts, size risk (volatility + barriers), and validate with a quick backtest.
Assumptions:
- MetaTrader 5 terminal is running.
- You call tools via
mtdata-cli <command> .... - Replace
EURUSDandH1with your symbol/timeframe.
Tip: add --json for structured output.
Forecast methods + availability (optional libraries show up here):
mtdata-cli forecast_list_methods --jsonForecast model spaces:
mtdata-cli forecast_list_library_models native --json
mtdata-cli forecast_list_library_models statsforecast --json
mtdata-cli forecast_list_library_models sktime --json
mtdata-cli forecast_list_library_models pretrained --jsonIndicators:
mtdata-cli indicators_list --limit 50
mtdata-cli indicators_describe rsi --jsonmtdata-cli symbols_list --limit 20
mtdata-cli symbols_describe EURUSD --json
mtdata-cli data_fetch_candles EURUSD --timeframe H1 --limit 300 --jsonOptional (liquidity snapshot):
mtdata-cli market_depth_fetch EURUSD --jsonCompute a few indicators:
mtdata-cli data_fetch_candles EURUSD --timeframe H1 --limit 1500 \
--indicators "ema(20),ema(50),rsi(14),macd(12,26,9)" \
--jsonDenoise before indicators (smoother inputs):
mtdata-cli data_fetch_candles EURUSD --timeframe H1 --limit 1500 \
--indicators "rsi(14),ema(50)" \
--denoise ema --denoise-params "columns=close,when=pre_ti,alpha=0.2,keep_original=true" \
--jsonDenoise after indicators (smoother signals):
mtdata-cli data_fetch_candles EURUSD --timeframe H1 --limit 1500 \
--indicators "rsi(14)" \
--denoise ema --denoise-params "columns=RSI_14,when=post_ti,alpha=0.3,keep_original=true" \
--jsonSimple baseline (Theta):
mtdata-cli forecast_generate EURUSD --timeframe H1 --horizon 12 \
--library native --method theta --jsonPattern-based “analog” forecast (nearest-neighbor style):
mtdata-cli forecast_generate EURUSD --timeframe H1 --horizon 12 \
--library native --method analog --params "window_size=64 search_depth=5000 top_k=20 scale=zscore" \
--jsonOptional: foundation model (if available):
mtdata-cli forecast_generate EURUSD --timeframe H1 --horizon 24 \
--library pretrained --method chronos2 --params "context_length=512" \
--jsonOptional: Monte Carlo simulation forecast (range of outcomes):
mtdata-cli forecast_generate EURUSD --timeframe H1 --horizon 12 \
--library native --method mc_gbm --params "n_sims=3000 seed=7" \
--jsonEWMA (fast default):
mtdata-cli forecast_volatility_estimate EURUSD --timeframe H1 --horizon 12 \
--method ewma --params "lambda=0.94" --jsonHAR-RV (uses intraday realized volatility):
mtdata-cli forecast_volatility_estimate EURUSD --timeframe H1 --horizon 12 \
--method har_rv --params "rv_timeframe=M5,days=150,window_w=5,window_m=22" --jsonBarrier probabilities (TP/SL odds within the horizon):
mtdata-cli forecast_barrier_prob EURUSD --timeframe H1 --horizon 12 \
--method hmm_mc --tp-pct 0.5 --sl-pct 0.3 --params "n_sims=5000 seed=7" \
--jsonBarrier optimization (search a TP/SL grid):
mtdata-cli forecast_barrier_optimize EURUSD --timeframe H1 --horizon 12 \
--method hmm_mc --mode pct --grid-style volatility --refine true \
--tp-min 0.25 --tp-max 1.5 --tp-steps 7 \
--sl-min 0.25 --sl-max 2.5 --sl-steps 9 \
--params "n_sims=5000 seed=7" --jsonInterpretation shortcuts:
edge≈ P(TP first) − P(SL first)prob_resolve≈ 1 − P(no hit)- Wider stops/targets may look “worse” on edge but can be better after accounting for time-to-hit and payoff ratio.
Change-points (BOCPD):
mtdata-cli regime_detect EURUSD --timeframe H1 --limit 1500 \
--method bocpd --threshold 0.6 --detail summary --lookback 300 --jsonRegime labels (HMM):
mtdata-cli regime_detect EURUSD --timeframe H1 --limit 1500 \
--method hmm --params "n_states=3" --detail compact --lookback 300 --jsonRun a rolling-origin backtest to compare a few methods:
mtdata-cli forecast_backtest_run EURUSD --timeframe H1 --horizon 12 \
--steps 50 --spacing 5 --methods "theta sf_autoarima analog" --jsonCandlestick patterns:
mtdata-cli patterns_detect EURUSD --timeframe H1 --mode candlestick --limit 500 \
--robust-only true --jsonClassic chart patterns:
mtdata-cli patterns_detect EURUSD --timeframe H1 --mode classic --limit 800 --jsonA pragmatic decision checklist:
- Forecast direction: do multiple methods agree on the sign of the next
horizonbars? - Volatility: is projected volatility within your risk budget?
- Regime: are you trading in a regime your strategy is designed for?
- Barriers: does the TP/SL pair have acceptable
edge/prob_resolve? - Patterns: do detections support or contradict the idea (optional)?
See TROUBLESHOOTING.md.
- CLI.md — Full command reference
- FORECAST.md — Forecasting methods guide
- TEMPORAL.md — Session and seasonal analysis
- BARRIER_FUNCTIONS.md — Barrier optimization deep dive
- SAMPLE-TRADE.md — Guided trade workflow