Walk-Forward Testing: Trading Strategy কি Unseen Data-তে টিকবে?
সর্বশেষ সংরক্ষিত:

Executive Summary
- ✦Earlier window-তে develop করে next unseen period-এ evaluate করুন।
- ✦Strategy-এর কারণ অনুযায়ী rolling বা expanding window বেছে নিন।
- ✦Parameter freedom সীমিত রাখুন এবং chronological order বজায় রাখুন।
- ✦Cost-এর পর stitched out-of-sample record simpler rule-এর সঙ্গে তুলনা করুন।
শেখার লক্ষ্য: walk-forward testing দিয়ে strategy development ও evaluation আলাদা করা এবং changing market condition-এ rule টিকে থাকে কি না দেখা।
যে history-তে performance report করা হয়, একই history দিয়ে parameter বেছে নিলে strategy অসাধারণ দেখাতে পারে। Test তখন past memorise করে। Walk-forward analysis আগের window-তে rule develop করে এবং পরের unseen window-তে evaluate করার process বারবার চালিয়ে এই সমস্যা কমায়।
এটি future profit guarantee করে না। সময়ের সঙ্গে research decision কীভাবে নেওয়া হতো তার বেশি realistic simulation তৈরি করে।
১. History chronological order-এ ভাগ করুন
প্রথম block in-sample window। এটি rule select বা estimate করতে ব্যবহৃত হয়। পরের block out-of-sample এবং rule fixed না হওয়া পর্যন্ত untouched থাকে।
উদাহরণ: তিন বছর development এবং পরের ছয় মাস evaluation। এরপর দুই window-ই সামনে সরিয়ে process repeat করা হয়। প্রতিটি step-এর out-of-sample result এক continuous record-এ join করা হয়।
Financial time series randomly shuffle করবেন না। Future observation training window-তে ঢুকতে পারবে না।
২. Rolling বা expanding window বেছে নিন
Rolling window fixed length রাখে, যেমন recent তিন বছর। New data ঢুকলে old data বাদ পড়ে। এটি regime change-এ adapt করতে পারে, তবে useful rare event বাদ দিতে পারে।
Expanding window fixed start date থেকে শুরু হয়ে সময়ের সঙ্গে বড় হয়। বেশি history ব্যবহার করে, কিন্তু old regime-এর influence বাড়তে পারে।
Choice strategy-এর সঙ্গে মিলতে হবে। Slow investment factor-এর long history দরকার হতে পারে; short-lived market effect-এ recent data বেশি দরকার। Design test করুন, তবে best final return দেয় বলেই বাছবেন না।
৩. Parameter freedom সীমিত করুন
শত শত parameter combination try করলে walk-forward test-ও overfit হতে পারে। Simple rule, broad stable parameter region এবং explicit selection method পছন্দ করুন। Failure-সহ প্রতিটি tested variant record করুন।
Moving-average rule শুধু 47 ও 193 day-এ কাজ করে কিন্তু nearby value-তে fail করলে precision সন্দেহজনক। Robust behaviour সাধারণত modest parameter change survive করে।
৪. Real implementation limit যোগ করুন
প্রতিটি out-of-sample window-এ cost, spread, slippage, liquidity limit ও point-in-time data দরকার। Scheduled re-optimisation date-এই parameter update করা যাবে। Later price দেখার পর earlier decision rewrite করা যাবে না।
Stitched result simple benchmark ও কখনো parameter না বদলানো fixed rule-এর সঙ্গে তুলনা করুন। Extra complexity-কে cost-এর পর value দিতে হবে।
Worked example
ধরা যাক, daily trend strategy-এর দুই parameter: lookback length ও exit speed। Ten-year history এভাবে test হয়:
- Year 1–3 দিয়ে small predeclared parameter grid থেকে choice।
- Rule freeze করে first six-month out-of-sample window-তে hypothetical trade।
- দুই window ছয় মাস সামনে roll।
- Year 10 পর্যন্ত repeat।
- শুধু out-of-sample segment join করে return, drawdown, turnover ও R-expectancy calculate।
In-sample run প্রতি trade average +0.35R; stitched out-of-sample record cost-এর পর +0.08R এবং deeper drawdown। Weaker result বেশি informative, কারণ এটি unseen data reflect করে। Performance একটি short window-এর ওপর depend করলে edge stable বলা যায় না।
Figureগুলো hypothetical এবং process বোঝায়; expected return নয়।
সাধারণ ভুল
- In-sample curve-কে strategy evidence হিসেবে report করা।
- Time-series observation randomly shuffle করা।
- অনেক window try করে শুধু winner publish করা।
- Out-of-sample period-এর ভেতর parameter বদলানো।
- Failed variant, cost বা delisted security বাদ দেওয়া।
- একটি favourable walk-forward run-কে edge proof বলা।
ব্যবহারিক checklist
- Timeline strictly chronological কি?
- প্রতিটি training window-তে কোন information allowed?
- Rule freeze না হওয়া পর্যন্ত out-of-sample block untouched কি?
- Rolling বা expanding window strategy দিয়ে justified কি?
- কত parameter combination attempt করা হয়েছে?
- Cost ও point-in-time data included কি?
- Final record কি শুধু unseen segment দিয়ে?
- Result simple fixed rule ও benchmark beat করে কি?
The Money Man-এর দৃষ্টিভঙ্গি
Walk-forward testing honest sequencing-এর discipline। Pattern খোঁজা এবং changing condition-এ operate করার পার্থক্য এটি দেখায়। Spectacular in-sample curve-এর চেয়ে stable, modest out-of-sample behaviour বেশি মূল্যবান; deterioration-কে optimise করে লুকানোর বদলে information হিসেবে দেখি।
শুধু শিক্ষামূলক তথ্য। এই tutorial AI-assisted এবং The Money Man প্রকাশিত। এটি ব্যক্তিগত investment advice, recommendation বা return-এর প্রতিশ্রুতি নয়। Backtest hypothetical এবং trading-এ loss হতে পারে।