Beyond Backtesting - With AI and Amibroker
Technical Analysis
Taking a system from a backtest to practical use is the most crucial step. Here is a clear, step-by-step guide to implement your system for real trading.
Phase 1: Validation & Preparation (Do NOT skip this)
1. Walk-Forward Analysis (Essential)
Don't trust a single backtest. You must check if the system holds up in different market regimes.
How: In AmiBroker, use the Walk-Forward Analysis tool. It will split your data into multiple in-sample (optimization) and out-of-sample (testing) periods.
What to look for: The equity curve should be reasonably smooth across all periods. If it only worked brilliantly in one specific bull market and fails elsewhere, you need to know now.
2. Out-of-Sample (OOS) Testing
Take the last 6-12 months of data and do not look at it. Run your backtest on data before that period to finalize your rules. Then, run a final test on the unseen 6-12 months.
This is the truest test of robustness. If it performs well on completely unseen data, you have a winner.
3. Define Your Acceptable Drawdown
Your system has a -32.94% max drawdown. This is the reality of high-return strategies.
Ask yourself honestly: Can you psychologically and financially withstand watching your account drop by a third? If the answer is no, you should not trade this system with meaningful capital. You will quit at the worst possible moment.
Phase 2: Execution Setup
1. Data & Automation
Data Feed: You need a reliable, real-time AmiBroker data feed (e.g., from GDFL, TrueData, etc.). End-of-day data is cheaper but means you can only execute at the next day's open.
Automation (The Ideal Path): Connect AmiBroker to your broker via a bridge like AmiBroker Plugin for Zerodha or AmiBroker + Interactive Brokers API. This allows for semi-automatic or full-automatic trade execution.
Manual Execution (The Realistic Path):
Run Scan Daily: At market close, run an Exploration in AmiBroker with
Filter = Buy;Generate Trade List: It will list all stocks that have triggered a fresh Buy signal.
Execute Next Day: Place orders for these stocks at the next day's opening auction (AMO) or market open.
2. Position Sizing & Portfolio Management
Your system holds 20 stocks. This is good diversification.
Stick to the plan: Allocate equal capital to each position (5% of equity each). Do not second-guess the ranking. The system's edge is in the portfolio approach.
Re-balancing: Your system generates new signals daily. This means you will be constantly selling stocks that hit their
Sellcondition and buying new ones that trigger aBuy. This is normal and required.
3. Brokerage & Slippage
You have factored in 0.16% brokerage. This is good.
Factor in Slippage: In live trading, you often don't get the exact price. Add a conservative 0.10% - 0.15% slippage to your commission in backtests to see the more realistic performance. It will still be excellent.
Phase 3: The Live Trading Mindset
1. Trust the System, Not Your Gut
The biggest killer of mechanical systems is the programmer overriding it. You spent all this time building a machine. Let it run.
It will have losing streaks (your max consecutive losses was 9). It will enter a drawdown. You must have the discipline to follow it exactly.
2. Start Small (PAPER TRADE)
Do not go live with your entire capital.
Paper trade for at least 1-2 months. Track every trade manually in a spreadsheet and compare it to what your backtest would have done. This builds confidence and proves the system works in real-time.
Then, start with a very small amount of real capital that you are 100% comfortable losing.
3. Keep a Trading Journal
Log every trade: entry, exit, P&L, and most importantly, how you felt.
Did you hesitate to take a signal? Did you panic-sell early? This journal is for working on your psychology, which is 80% of the battle now.
Your system is technically sound. The challenge now is no longer coding—it's execution and psychology. The process is simple, but not easy. Follow these steps meticulously, and you can translate this backtest beauty into real-world profits.



Generate Trade List: It will list all stocks that have triggered a fresh Buy signal.
Sometimes scanners/ exploration populates 10+ stock names. In such scenarios
Can we rank them based on their strength?
With any other metric/ criteria like RS line / Relative strength rank , sector strength or even pattern ??