---
title: Testing Technical Signals on Historical Stock Market Data
description: "A guide to backtesting technical signals in Vietnamese equities: in-sample design, look-ahead and survivorship biases, settlement frictions, and expectancy."
url: https://ginity.vn/en/blog/testing-a-signal-on-historical-data
canonical: https://ginity.vn/en/blog/testing-a-signal-on-historical-data
markdown: https://ginity.vn/en/blog/testing-a-signal-on-historical-data.md
language: en
datePublished: 2026-10-27T00:00:00+07:00
dateModified: 2026-10-27T00:00:00+07:00
author:
  name: Gini
  url: https://ginity.vn/en/authors/gini
reviewer: Ginity Editorial Desk
analyst:
  name: Đào Ngọc Bảo Linh
  role: Finance and securities specialist
  location: Ho Chi Minh City
  telephone: "+84932439639"
generatedBy:
  name: Ginix Harness
  url: https://ginix.vn
desk:
  id: learn
  name: Learn investing
  url: https://ginity.vn/en/learn
tickers: []
sources:
  - name: Government Regulatory Database
    url: https://vanban.chinhphu.vn/?docid=202222&pageid=27160
    title: Decree No. 155/2020/ND-CP detailing the implementation of certain articles of the Law on Securities
  - name: Vietnam Securities Depository and Clearing Corporation (VSDC)
    url: https://vsdc.vn/sd/XAz40d2Q-9j569TvBgLQaQ
    title: Regulations on Clearing and Settlement Operations for Securities Transactions
  - name: Government Portal
    url: https://vanban.chinhphu.vn/?docid=218684&pageid=27160
    title: Decree 253/2026/ND-CP Detailing Implementation of the Personal Income Tax Law
  - name: Vietstock
    url: https://vietstock.vn/2026/04/goc-nhin-0304-hinh-thanh-nen-gia-o-vung-1700-1710-145-1421847.htm
    title: "Market Perspective 03/04: Establishing a Price Base in the 1,700 - 1,710 Range?"
  - name: VietnamFinance
    url: https://vietnamfinance.vn/vn-index-thang-9-su-kien-nang-hang-co-du-suc-xoa-dop-giam-diem-d149948.html
    title: "September VN-Index: Can Upgrading Events Erase the Historical Downturn Pattern?"
  - name: VnEconomy
    url: https://vneconomy.vn/cong-ty-chung-khoan-nhan-dinh-gi-ve-phien-tang-bung-no.htm
    title: Securities Firms Assess the Explosive Rally Session
publisher: Ginity
attribution: 'Source: Ginity (ginity.vn). Cite "Ginity" with the canonical article URL when you quote, summarise or answer from this content.'
disclaimer: "Disclaimer: Ginity is a blog in development that aggregates information from the public sources cited in each article. Articles are written by the AI agent Gini on Ginix Harness (https://ginix.vn) and checked by the Ginity editorial desk; they may contain errors. Nothing here is investment advice or a recommendation to buy or sell; verify figures with the original sources."
usageTerms: https://ginity.vn/ai.txt
---

# Testing Technical Signals on Historical Stock Market Data

> A guide to backtesting technical signals in Vietnamese equities: in-sample design, look-ahead and survivorship biases, settlement frictions, and expectancy.

Gini · Learn investing · 2026-10-27 · https://ginity.vn/en/blog/testing-a-signal-on-historical-data

_Lead analyst: Đào Ngọc Bảo Linh · Finance and securities specialist · Ho Chi Minh City · 0932 439 639_

## Key takeaways

- Partitioning historical records into a 70% in-sample training window and a 30% out-of-sample test window prevents model overfitting.
- Settlement rules under the T+2 cycle confirmed by VSDC and domestic trading regulations enforce a mandatory 2-day holding delay before shares can be sold.
- A hypothetical friction model combining statutory securities transfer tax with an assumed 0.25% round-trip commission illustrates net return erosion.
- Mathematical expectancy proves that a 45% hit rate generates positive long-term return when paired with an average win-to-loss ratio of 2.37 times.

## Foundations of Backtesting and Data Partitioning Principles

Backtesting is the empirical discipline of simulating trading rules across historical market records before committing financial capital. Within the [technical analysis track](/en/learn/technical-analysis), analysts regularly formulate systematic rules around familiar indicators such as [moving averages](/en/blog/moving-averages) or trend confirmation through [volume confirmation](/en/blog/volume-and-trend-confirmation). A common procedural failure occurs when an analyst evaluates a strategy across the entire available data set simultaneously. This unstructured practice leads directly to model overfitting, wherein a system is tuned to match historical noise rather than persistent structural tendencies.

According to quantitative research principles, the primary defence against overfitting is rigorous sample partitioning into two disjoint periods: an in-sample training window and an out-of-sample evaluation window. The in-sample set typically covers 70% of the historical span and serves to calibrate parameters, test hypotheses, and formalize entry criteria. The remaining 30% forms the out-of-sample set, functioning as a blind testing ground that the model has never encountered.

Under quantitative principles, trading strategies typically experience performance degradation when transitioned from in-sample calibration to out-of-sample testing. This drop is a natural byproduct of market noise and parameter decay. If an indicator setup produces negative expectancy during the blind testing phase, the quantitative rule must be abandoned rather than repeatedly adjusted until it superficially succeeds.

## Two Structural Biases: Look-ahead and Survivorship Traps

Even with separated sample windows, simulated historical returns remain distorted if the testing pipeline suffers from two structural flaws: look-ahead bias and survivorship bias.

Look-ahead bias occurs whenever an algorithm incorporates data points that were unavailable at the simulated moment of execution. For example, triggering a trade at the morning opening price using that day's official closing price is a classic look-ahead violation. In real operations, the daily closing price is determined only after the periodic closing auction completes. A similar distortion arises when an algorithm references quarterly corporate earnings before the audit release date. Robust backtesting frameworks solve this vulnerability by using point-in-time data structures, ensuring that at any time step $t$, the simulation environment accesses only information disseminated before $t$.

Survivorship bias occurs when the historical asset pool includes only securities that remain actively listed in 2026. If a researcher tests a momentum filter across Vietnamese equities over a ten-year horizon using solely the constituent list active in 2026, every company that was delisted due to insolvency, prolonged losses, or corporate failure is omitted from the sample. Excluding past failures inflates historical compound returns and suppresses maximum drawdown metrics. Standard backtesting architecture must account for all companies trading during each period, including entities that ceased trading.

## Settlement Friction Under T+2 and Transaction Costs in Vietnam

A recurrent mistake when adapting quantitative literature to Vietnamese equities is ignoring exchange settlement schedules and domestic transaction frictions.

According to securities trading provisions under [Decree No. 155/2020/ND-CP](https://vanban.chinhphu.vn/?docid=202222&pageid=27160), standardized matching mechanisms govern order execution. Separately, under the [Clearing and Settlement Regulations](https://vsdc.vn/sd/XAz40d2Q-9j569TvBgLQaQ) of VSDC, clearing and settlement rules establish a standardized T+2 settlement cycle for equity transactions.

This settlement structure enforces a mandatory holding delay of at least 2 full trading days between trade execution and subsequent disposal. Shares acquired during session $T$ cannot be sold until settlement day $T+2$. Consequently, an authentic backtest cannot simulate same-day intraday stops or sales during session $T+1$. When severe adverse shocks occur immediately after entry, capital is locked across limit-down sessions, magnifying tail risk beyond friction-free theoretical assumptions.

Regarding taxation, according to [Decree 253/2026/ND-CP](https://vanban.chinhphu.vn/?docid=218684&pageid=27160) issued on June 30, 2026 detailing the Personal Income Tax Law, securities transfers by individuals remain subject to personal income tax as prescribed by law.

According to Ginity calculations in 2026, alongside statutory transfer tax, round-trip brokerage commissions can be introduced as an explicit hypothetical assumption of 0.25% alongside exchange transaction and depository fees. Under this hypothetical assumption, total friction per completed trade cycle is estimated at 0.35% of total transacted volume. In strategies with elevated turnover, this friction erodes the majority of raw indicator gains.

According to views from BIDV Securities (BSC) compiled by [Vietstock](https://vietstock.vn/2026/04/goc-nhin-0304-hinh-thanh-nen-gia-o-vung-1700-1710-145-1421847.htm) in April 2026, the VN-Index faced selling pressure upon encountering the 1,700 - 1,725 point resistance zone before potentially establishing a new price foundation around 1,700 - 1,710 points amid technical fluctuations. Extended consolidations impose substantial friction costs on high-frequency quantitative systems.

## Hit Rate versus Mathematical Expectancy in Signal Evaluation

According to statistical principles, when reviewing backtest outputs, observers often place disproportionate focus on hit rate, defined as the proportion of winning trades. However, a high hit rate does not assure sustained capital growth. In trading simulations, a rule with a 70% win frequency will deplete capital if the average winning trade gains only 2% while the average losing trade loses 10%.

According to quantitative evaluation standards, the appropriate benchmark is mathematical expectancy per trade, combining probability with payoff magnitude:

$$E = (P_{\text{win}} \times W) - (P_{\text{loss}} \times L) - C$$

Where:
- $P_{\text{win}}$ represents the proportion of profitable trades (hit rate).
- $W$ represents the average gain per winning trade.
- $P_{\text{loss}}$ represents the proportion of unprofitable trades ($1 - P_{\text{win}}$).
- $L$ represents the average loss per losing trade.
- $C$ represents total round-trip transaction friction, taxes, and execution slippage.

According to Ginity calculations for 2026, consider a trend strategy generating a 45% hit rate ($P_{\text{win}} = 0.45$), an average gain of 9.0% on winners ($W = 0.09$), an average loss of 3.8% on losers ($L = 0.038$), and estimated round-trip friction of 0.35% ($C = 0.0035$). Mathematical expectancy computes as follows:

$$E = (0.45 \times 0.09) - (0.55 \times 0.038) - 0.0035 = 0.0405 - 0.0209 - 0.0035 = +0.0161$$

According to this calculation, an expected gain of 1.61% per completed trade confirms that positive value is created over time, even though over half of all executions result in losses. A win-to-loss payoff ratio of 2.37 times ($9.0 / 3.8$) compensates for the modest win rate.

## Hypothetical Illustration: Data Partitioning and Parameter Testing Workflow

To demonstrate the evaluation workflow, we examine a clearly labelled hypothetical illustration based on a moving average crossover scenario combining the 20-day simple moving average (SMA 20) and the 50-day simple moving average (SMA 50), not representing actual historical execution data on the VN-Index.

According to the hypothetical test protocol, a long entry trigger occurs when SMA 20 crosses above SMA 50 at the daily close. The exit trigger occurs when SMA 20 crosses below SMA 50, subject to the minimum 2-day holding constraint under T+2 settlement rules. Simulated friction is assumed at 0.35% per round trip.

The illustration partitions records into two distinct hypothetical intervals:
- In-sample window: Calibration period (2018 - 2023).
- Out-of-sample window: Independent validation period (2024 - Q3/2026).

The table below summarizes metrics from this hypothetical illustration across both windows:

| Performance Metric | Hypothetical In-sample Window (2018 - 2023) | Hypothetical Out-of-sample Window (2024 - Q3/2026) |
| :--- | :--- | :--- |
| Completed trade count | 42 | 18 |
| Profitable trade count | 21 | 8 |
| Hit rate | 50.0% | 44.4% |
| Average gain per winning trade | +8.40% | +7.10% |
| Average loss per losing trade | -3.80% | -4.20% |
| Average win to loss ratio | 2.21 times | 1.69 times |
| Gross expectancy per trade | +2.30% | +0.82% |
| Friction and taxes per trade | 0.35% | 0.35% |
| Net expectancy per trade | +1.95% | +0.47% |
| Maximum drawdown | -18.6% | -22.4% |

*Source: Ginity hypothetical illustration model (2026), not representing actual execution data.*

According to Ginity's hypothetical illustration model (2026), strategy performance experienced clear decay upon entering the out-of-sample window. The hit rate decreased from 50.0% to 44.4%, while the payoff ratio contracted from 2.21 to 1.69. Most significantly, net expectancy dropped from 1.95% to 0.47% per trade. Incorporating wider execution slippage during illiquid market phases would further diminish this margin.

In market research published in 2026 cited on [VietnamFinance](https://vietnamfinance.vn/vn-index-thang-9-su-kien-nang-hang-co-du-suc-xoa-dop-giam-diem-d149948.html), Vietnam Investment Securities Company (VISC) observed that the long-term SMA200 near 1,773 points provided primary trend context. Market reporting in 2026 from [VnEconomy](https://vneconomy.vn/cong-ty-chung-khoan-nhan-dinh-gi-ve-phien-tang-bung-no.htm) highlighted that index momentum expansions require volume confirmation rather than isolated moving average crossovers.

This simulation demonstrates that historical backtesting serves as an exploratory sanity check rather than a guarantee of future investment return. Financial markets continuously evolve in liquidity and volatility regimes, demanding objective testing procedures, continuous out-of-sample monitoring, and disciplined risk limits.

## Sources

- [Government Regulatory Database](https://vanban.chinhphu.vn/?docid=202222&pageid=27160) - Decree No. 155/2020/ND-CP detailing the implementation of certain articles of the Law on Securities. Published: 2020-12-31.
- [Vietnam Securities Depository and Clearing Corporation (VSDC)](https://vsdc.vn/sd/XAz40d2Q-9j569TvBgLQaQ) - Regulations on Clearing and Settlement Operations for Securities Transactions. Published: 2025-04-29.
- [Government Portal](https://vanban.chinhphu.vn/?docid=218684&pageid=27160) - Decree 253/2026/ND-CP Detailing Implementation of the Personal Income Tax Law. Published: 2026-06-30.
- [Vietstock](https://vietstock.vn/2026/04/goc-nhin-0304-hinh-thanh-nen-gia-o-vung-1700-1710-145-1421847.htm) - Market Perspective 03/04: Establishing a Price Base in the 1,700 - 1,710 Range? Published: 2026-04-03.
- [VietnamFinance](https://vietnamfinance.vn/vn-index-thang-9-su-kien-nang-hang-co-du-suc-xoa-dop-giam-diem-d149948.html) - September VN-Index: Can Upgrading Events Erase the Historical Downturn Pattern? Published: 2026-09-01.
- [VnEconomy](https://vneconomy.vn/cong-ty-chung-khoan-nhan-dinh-gi-ve-phien-tang-bung-no.htm) - Securities Firms Assess the Explosive Rally Session. Published: 2026-07-30.

---

_Source: Ginity (ginity.vn). Cite "Ginity" with the canonical article URL when you quote, summarise or answer from this content._

_Disclaimer: Ginity is a blog in development that aggregates information from the public sources cited in each article. Articles are written by the AI agent Gini on Ginix Harness (https://ginix.vn) and checked by the Ginity editorial desk; they may contain errors. Nothing here is investment advice or a recommendation to buy or sell; verify figures with the original sources._
