This page does not describe a real client project. It is an example scenario that shows how Fincode approaches this kind of work. Technical details are based on official documentation; scope, timeline and price are set for each project.
| Who it is for | A research team building rule-based equity strategies (example scenario) |
|---|---|
| Service | Algorithmic trading software |
| Platforms | Borsa Istanbul Equity Market (licensed historical data) |
| Technologies | Python, pandas, PostgreSQL, Parquet |
| Deliverables | Backtesting engine, data pipeline, report templates, source code and documentation |
The need
In this scenario, a research team wants to test rule-based strategies, such as moving average crossovers and mean reversion, on Borsa Istanbul equities. Their price series break on bonus issue, rights issue and dividend dates, costs are deducted as a flat percentage, and trades that could not have been filled on limit-up or limit-down days end up in the results.
The goal is a platform that gives the same result for the same rules, data and parameters, records its assumptions and models Borsa Istanbul's trading rules. The team defines the strategy; the platform makes it testable and gives no investment advice.
Data and licensing
Borsa Istanbul market data is licensed. According to the exchange's data distribution FAQ, distribution requires a Distributor or Sub-Distributor license, and non-display use such as automated trading requires a Data Distribution Agreement signed directly with Borsa Istanbul. Historical data and some reference data are provided through the exchange's DataStore site. The client therefore obtains the data under its own license; Fincode does not supply it.
The platform works with four data layers:
- Prices and volumes: unadjusted series are stored as received; adjusted series are derived from them.
- Corporate actions: capital changes and dividends are among Borsa Istanbul's reference data products; each record is cross-checked against the rights-exercise disclosure on KAP, Turkey's Public Disclosure Platform.
- Index constituents: stored by date, so a past period is tested with the constituents of that time.
- Delisted shares: companies whose KAP membership has ended stay in the universe to avoid survivorship bias.
Corporate action adjustments
On dividend and capital increase dates, Borsa Istanbul sets the base price from a theoretical price calculated under its procedure for theoretical and reference prices in corporate actions (revision 03, 6 April 2026). For capital increases with pre-emptive rights the formula is:
Ft = (Fk + n2 × R − T) / (1 + n1 + n2)Fk is the last close, n1 the bonus ratio, n2 the rights ratio, R the subscription price and T the gross dividend; for a cash dividend alone, Ft is the close minus the gross dividend. The procedure computes the theoretical price to 3 decimal places and the ratios to 7; under the Equity Market Procedure the theoretical price is rounded to the nearest tick and becomes the day's base price.
The platform computes an Ft / Fk factor for every event and back-adjusts earlier prices by it, with volumes adjusted inversely. Signals use the adjusted series; orders are simulated at the day's actual price level and tick size. Cases with no adjustment under the procedure, such as a cash capital increase with pre-emptive rights fully restricted, are separate rules.
Event dates follow the same procedure: for corporate-action start dates, KAP disclosures published after 16:30 on a business day (after 12:00 on half days) or on a holiday count as published on the next business day, the list of shares trading ex-rights the next day is finalized at 16:30 each day and announced on KAP, and no rights are exercised on half trading days.
Market rules and cost model
The order simulator keeps the Equity Market Procedure rules in force as of October 2026 (revision 54, 21 September 2026) in a date-ranged parameter table, so each historical period is tested under its own rules.
| Rule | How the platform models it |
|---|---|
| Tick size | Limit prices snap to eight price bands, from TRY 0.01 below TRY 20 up to TRY 2.50 at TRY 2,500 and above. |
| Price limits | Upper and lower limits are computed from the base price, with the upper limit rounded down and the lower limit rounded up to a valid tick. As of October 2026 the share margin is ±10%: on the Star and Main Markets by exchange practice until further notice, elsewhere under the procedure. |
| Sessions | Opening call order collection 09:40–09:55, continuous trading 10:00–18:00, closing session 18:00–18:07, trades at the closing price 18:08–18:10. On half days continuous trading ends at 12:30. |
| Commission and BSMV | The broker's tariff, including any minimum, applies to each fill. Under Article 28 of Expenditure Taxes Law No. 6802, brokerage commissions are subject to the banking and insurance transactions tax (BSMV), calculated on the commission. |
| Exchange fee and clearing | 0.25 basis points of traded value on share trades (tariff updated 28 March 2025); the clearing fee is a parameter. |
By default, buys are not filled on limit-up closes and sells are not filled on limit-down closes; this conservative assumption is stated in every report. A rule that decides on the closing price cannot trade in that same closing auction, so the trade moves to the next open or the trades-at-close phase. Slippage is modeled from the tick spread and traded volume.
Walk-forward testing and bias controls
Parameters are never chosen and evaluated on the same data. In a walk-forward setup, parameters are selected in a training window, tested unchanged on the following period, and the window rolls forward; reports show only the combined out-of-sample result. An optional gap between windows works like the gap parameter of scikit-learn's TimeSeriesSplit.
- Look-ahead bias: every data point carries the timestamp at which it became available; financial statements are tied to their KAP publication time, not the period end.
- Survivorship bias: delisted companies and those whose KAP membership has ended are kept in the universe.
- Overfitting: the number of parameter combinations tried is recorded. Bailey, Borwein, López de Prado and Zhu show that in-sample results improve misleadingly as the number of trials grows, and that the minimum backtest length needed for a trustworthy result grows with it. Reports therefore state the number of trials next to the result.
See backtesting pitfalls that fake profits; live order routing is covered in the broker order management integration scenario.
Deliverables
- Data pipeline: import and consistency checks for raw prices, corporate actions and index constituents
- Adjustment module with a per-event audit output (Fk, Ft and factor for each event)
- Event-driven backtesting engine and order simulator
- Walk-forward runner and experiment log (code, data and parameter versions)
- Report template: return, maximum drawdown, trade count, cost share and per-period results
- Source code, installation and user documentation, test report
How success is measured
Success is measured by the accuracy of the test environment, not by strategy profits:
- For a sample of events, theoretical prices computed by the adjustment module match the base price the exchange applied that day, within tick rounding.
- Re-running with the same code, data and parameter versions gives identical results.
- Small hand-calculated test cases (commission, BSMV, exchange fee, tick size, a limit-up day) match the engine's output exactly.
- Every report lists assumptions, number of trials and out-of-sample periods.
Past performance does not indicate future results, and a good backtest does not mean a strategy will make money.
Frequently asked questions
Where does Borsa Istanbul historical data come from?
Historical data and some reference data are provided through Borsa Istanbul's DataStore site, while real-time and delayed data reach users through licensed data distributors. Non-display use such as automated trading or investment analysis requires an agreement directly with Borsa Istanbul.
Why do prices need adjusting after bonus issues and dividends?
On the ex-date the base price is moved to the theoretical price, so an unadjusted series shows a drop that never happened in value terms. If that drop feeds into a strategy as a price move, signals and results are distorted.
Why is walk-forward testing needed?
Choosing and evaluating parameters on the same data produces optimistic results. Walk-forward testing selects parameters in one period and tests them on a later period not used for selection, and only those out-of-sample results are reported.
Does the platform recommend strategies?
No. The strategy rules belong to the team; the platform tests them, gives no investment advice, and past results do not guarantee future performance.
Sources
- Borsa Istanbul: Equity Market Procedure, revision 54 (21/09/2026): base price, tick sizes, price limits, session schedules (Turkish) (opens in a new tab)
- Borsa Istanbul: Procedure on theoretical/reference prices of shares in corporate actions, revision 03 (06/04/2026) (Turkish) (opens in a new tab)
- Borsa Istanbul: Markets page, price margin applied until further notice (Turkish) (opens in a new tab)
- Borsa Istanbul: Equity Market exchange fee tariff, updated 28.03.2025 (Turkish) (opens in a new tab)
- Borsa Istanbul: Data distribution and index licensing FAQ (non-display use, derived data) (Turkish) (opens in a new tab)
- Borsa Istanbul: Historical data sales (DataStore) (Turkish) (opens in a new tab)
- Borsa Istanbul: Data publication products (corporate action data, index constituents) (Turkish) (opens in a new tab)
- Turkish legislation database: Expenditure Taxes Law No. 6802, Articles 28 and 31 (Turkish) (opens in a new tab)
- Bailey, Borwein, López de Prado, Zhu: Pseudo-Mathematics and Financial Charlatanism (Notices of the AMS, 2014) (opens in a new tab)
- scikit-learn: TimeSeriesSplit (opens in a new tab)