PROTECTED SOURCE SCRIPT

OTS Trend Suite (Open Trend System)

43
OTS (Open Trend System)

Components

Trend Suite (overlay): Macro Trend Bars + Track, Micro Dots, Reversal “R” (+2 bar confirm), T/B (+1), (opt) Strength/Weakness arrows.
Confirmation (panel): RSI 3-line + momentum crosses, (opt) divergences; Thrust histogram (Blue/Green/Red/Orange via z-score).
Support/Resistance (overlay): pivot-temelli dinamik S/R çizgileri.
Presets & Micro-cap Notes

Equity-4H: ATR(14)×2.0 macro track, BB(20,2.0), wickFrac 0.65 — liquid US equities, intraday swing focus.
Equity-1D (small/micro): ATR(14)×2.2 macro track, BB(20,2.2), wickFrac 0.70 — dampens noise for thin micro-cap sessions.
FX-1H: Retains ATR(10)×2.2 profile for tighter FX structures; enable Custom for bespoke tuning.
RTH-only thrust: Panel default keeps 09:30–16:00 ET (session input) so after-hours volume spikes stop inflating micro-cap thrust z-scores.
Market Microstructure Notes (US Equities)

SIP / CTA-UTP plumbing: Consolidated tapes publish NBBO and LULD bands; thrust auto-cal keeps RTH default so AH/SIP hiccups do not distort robust z quantiles.
LULD reopen guard: Without a real-time halt feed we flag session-open gaps ≥ gapThresh as reopen-like and suppress entries for that bar; manual labels remain for review while Python backtests can plug in full halt datasets.
Survivorship-free calibration: Use Norgate/CRSP EOD universes when deriving quantile windows so delisted micro-caps do not bias thrust tails during auto-bucket calibration.
Non-repainting: Trade sinyali yalnız onay sonrası. Financial disclaimer: Eğitim amaçlıdır.

Operator Quickstart (US Equities – Small/Micro-cap)

Overlay: OTS Trend Suite → Preset = Equity-1D (small/micro) (günlük) veya Equity-4H (iç seans).
Panel: OTS Confirmation → Use RTH only açık (09:30–16:00). Micro-cap’te AH hacim sapmalarını ezer.
S/R: OTS Support/Resistance → max lines 8; range yoğunluklarında okunabilirlik için iyi.
Preset Mapping

Preset ATR× BB wickFrac pivotL Micro ATR×
Equity-4H 14×2.0 20×2.0 0.65 6 7×1.5
Equity-1D (small/micro) 14×2.2 20×2.2 0.70 6 7×1.5
FX-1H 10×2.2 20×2.2 0.60 6 7×1.5
Alert Reference

Alert Anlam İşlem Disiplini
Macro Trend Flip Ana trend rengi değişti Pozisyon yönünü yalnız trend yönünde tut
R / R✓ Tersine dönüş barı / onaylandı Yalnız R✓ sonrası trade
T / T✓ Lokal tepe / onaylandı T✓’de kar al/short araması
B / B✓ Lokal dip / onaylandı B✓’de long araması
RSI Bull/Bear Momentum kesişimi Sinyal teyidi
Thrust ORANGE Aşırı kurumsal baskı Breakout/kapitulasyon teyidi
Micro-cap Notları

RTH-only Thrust: AH sapmaları şişer; RTH filtre varsayılan.
Compact Mode: dot/etiket/ok spam’ini azaltır; tarama performansı için aç.
Halts/LULD: Re-open barı genelde işlem dışı bırakmak daha temiz sinyal verir (ileri sürümde toggle).
Manual QA (hızlı)

SPY 4H: Macro flip ve Strength/Weakness okları trend içinde kalıyor mu?
IWM 1D: RTH-only Thrust renkleri stabil mi?
3–5 micro-cap: Equity-1D preset + Compact Mode on/off görsel karşılaştır.
Testing

How to run: source .venv/bin/activate && make dev-setup && make lint && make test
What's covered: R-confirm window, macro flip debounce, robust thrust + RTH gating.
Environment Notes

Python 3.11 is the supported baseline. Python 3.13 is workable as long as pip resolves numpy>=2.1.0 (handled by the conditional pin).
Snapshots render charts with the non-interactive Matplotlib Agg backend (MPLBACKEND=Agg set by default).
yfinance downloads are chunked (<=25 tickers) with threads=True and paced sleeps to reduce rate-limit risk.
Snapshot (No-TradingView)

Calibrated quantiles → pGreen=0.70, pOrange=0.98 (micro-cap tails). gap_thresh=0.10 default. Use --interval (1d, 60m, 30m) to choose resolution; daily bars rely on first-of-day fallback for the guard. How to run:

source .venv/bin/activate
make dev-setup
python apps/py/snapshots/run_equities_snapshot.py --tickers-file data/inputs/microcaps.txt --start 2024-01-01
What it produces:

CSV exports under reports/snapshots/<date>/ covering summary metrics, trade blotter, thrust buckets, and guard suppressions.
PNG charts in reports/snapshots/<date>/charts/ illustrating price, macro track, and entry/exit markers for active symbols.
guard_suppressed counts highlight bars skipped by the LULD reopen guard; thrust shares show time in each thrust regime; R-multiple aggregates trade efficiency relative to ATR risk.
Provider & Fallbacks

--provider yf|csv|synthetic selects the data backend (default yf).
--csv-dir should point at a folder containing <SYMBOL>.csv files with columns Date,Open,High,Low,Close,Volume (case-insensitive).
--tz controls the output timezone for timestamps (default America/New_York). Synthetic fallbacks respect US trading hours, DST shifts, and NYSE holiday/early-close calendars in the selected timezone.
Synthetic generation is controlled via --synthetic-seed, --synthetic-gap-prob, and --synthetic-gap-scale; the runner seeds a Laplace gap model around a 2%/√252 daily volatility baseline.
yfinance downloads automatically write CSV caches under --csv-dir and reuse them on subsequent 429 retries before falling back to synthetic data (provider_used=csv_cache/yf_synthetic_fallback).

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.