Institutional Charter & Transparency Hub

Methodology & Data Quality Hub

Deterministic mathematical formulations, data integrity guarantees, and friction models governing Dragonfly.co.

Live Data Provenance & Quality Audit

Session: 2026-11-04 (Asia/Dhaka)
Total Historical Quotes1,633,3811999-01-10 through 2026-11-04
Covered Equities & Funds415 Stocks100% active DSE tradeable universe
Zero-Close Sanitization524 CorrectedMapped CLOSEP=0 → NULL to prevent division skew
Duplicate Rejection Rate100% EnforcedStrict UNIQUE(stock_id, date) table constraint
Dual-Engine Ingestion PipelineLive Scraping + ArchiveDirect from official DSE endpoints (dsebd.org)
Database Storage StandardMySQL 8 / SQLite WALconnectionLimit: 5 singleton pool

Deterministic Mathematical Formulations

Zero Black-Box Logic • Fully Reproducible

1. Discrete Kalman Velocity Filter

State Space

Estimates true underlying trend velocity while separating transient microstructure liquidity noise from persistent institutional order flow.

x_k = A * x_(k-1) + w_k,   w_k ~ N(0, Q)

z_k = H * x_k + v_k,       v_k ~ N(0, R)

Velocity = x_k[1]   (Dhaka points per trading session)

Prevents premature whip-saws during low-volume choppy sessions without introducing the lag of traditional 200-session moving averages.

2. Wilder's Smoothed RSI (14 Sessions)

Momentum

Calculates relative price momentum using J. Welles Wilder's exponential smoothing method rather than simple arithmetic averaging.

RS = SmoothedAvgGain / SmoothedAvgLoss

RSI = 100 - (100 / (1 + RS))

SmoothedAvg = (PrevAvg * 13 + Current) / 14

Bounded strictly between 0 and 100. Values above 70 indicate elevated buying pressure; below 30 indicates oversold conditions.

3. Chaikin Money Flow (CMF 20 Sessions)

Volume Flow

Measures the accumulation/distribution volume over 20 trading sessions to verify whether price expansions have genuine volume sponsorship.

CLV = ((Close - Low) - (High - Close)) / (High - Low)

CMF_20 = SUM(CLV * Volume, 20) / SUM(Volume, 20)

If High == Low (e.g. floor price locked), CLV is deterministically defined as 0.0 to prevent division by zero.

4. FIFO Cost Basis & Realized P&L

Accounting

Portfolio management strictly executes First-In, First-Out lot balancing with accurate tracking for partial sells and brokerage commissions.

Buy Cost = Shares * Price + Commission

Net Proceeds = SoldShares * Price - Commission

Realized P&L = Net Proceeds - (FIFO Matched Cost)

Includes dedicated ledger handling for cash deposits, cash withdrawals, and dividend distributions.

5. Max Adverse Excursion & Drawdown

Risk

Evaluates the maximum intra-trade drawdown experienced by an open position or strategy backtest before target achievement or exit.

MAE = (EntryPrice - LowestLowDuringTrade) / EntryPrice

MaxDrawdown = (PeakPortfolioValue - Trough) / Peak

Institutional backtests display honest no-trade periods, worst-case drawdown, and liquidity-adjusted capital capacity.

6. 52-Week Corridor Normalization

Valuation

Determines where current price trades relative to the rolling 52-week (approx. 240 trading sessions) high and low corridor.

CorridorPos = (LTP - Low_52W) / (High_52W - Low_52W) * 100%

Bounded: [0%, 100%]

Positions > 80% indicate proximity to annual highs; < 20% indicate proximity to annual lows or floor price support.

Market Friction & Regulatory Disclosures

Bangladesh Securities and Exchange Commission (BSEC) Context

0.40% Brokerage Commission Friction

All strategy backtests, paper trades, and portfolio transaction ledgers deduct a default 0.40% commission on every buy and sell. Many retail platforms display inflated theoretical profits by ignoring broker commissions and exchange fees; Dragonfly.co enforces friction realism.

Floor Price & Circuit Breaker Disclosures

During regulatory floor price interventions, stocks hitting lower circuit limits may have zero executable buy orders for consecutive weeks. Our platform explicitly tags "Circuit Locked" symbols and flags that theoretical stop-losses cannot execute in liquidity-frozen markets.

Language Precision: "Unusual Activity"

In compliance with regulatory standards, our anomaly detection module uses the objective term "Unusual Activity & Statistical Outliers" rather than speculative operator claims. Every flagged anomaly specifies its mathematical z-score threshold.

Canonical Timezone Standard (Asia/Dhaka)

All daily sessions, EOD batch imports, and news announcements are indexed strictly in canonical ISO 8601 Asia/Dhaka (+06:00). This eliminates UTC offset shifts and weekend trading misclassifications across DSE Sunday–Thursday sessions.

Settlement-Aware Holding Periods & Depository Cycles (CDBL)

Unlike Western exchanges supporting margin day-trading, Bangladesh law and Central Depository Bangladesh Ltd (CDBL) mandate strict dematerialized share delivery prior to sell authorization. Under DSE clearing rules:

  • Regular Equities (Classes A, B, N): Require T+2 business trading days before shares become sell-available in your BO account.
  • Non-Compliant (Class Z): Enforces T+3 business trading days settlement cycle with heightened default risk.
  • Alternative Trading Board (ATB): Unlisted debt and venture securities enforce T+4 business trading days.
  • Cash Settlement Delay: Sale proceeds undergo clearing; cash withdrawal to bank accounts (BEFTN/NPSB) clears T+2 (or T+4 for ATB) after sell execution.
  • Trading Calendar Exclusions: Fridays, Saturdays, and statutory exchange holidays are strictly excluded from settlement countdowns.

Separation of Legal Settlement from Investment Horizons:

Settlement-AwareMin 2 SessionsStatutory unlock
Tactical Swing5 to 20 SessionsMomentum pulses
Systematic Trend20 to 90 SessionsKalman velocity
Long-Term Value6 to 24 MonthsDividend compound
Non-Guarantee Compliance Disclosure: Holding periods, settlement cycles, and target dates are risk-management and legal depository clearing parameters. They do NOT constitute guaranteed profit recommendations or financial advice.

Automated Data Sanitization Pipeline Rules

Continuous Ingestion Audit
Validation CheckConditionEnforcement ActionStatus
Zero Close SanitizationCLOSEP == 0.0Replaced with NULL (prevent zero-division)Active (854 resolved)
Duplicate Prevention(stock_id, date) duplicateRejected by database unique indexActive (100% blocked)
OHLC Range CoherenceLow > High or Close < 0Row quarantine into import_logsActive
Session GapsMissing trading days in calendarAutomated backfill catch-up runnerActive
Connection ResilienceMySQL unreachable / rate limitedInstant fallback to local SQLite WALActive