AFL 2015
Amibroker AFL Programming Workshop
Bangalore
© Copyright 2015 Marketcalls Financial Services Pvt Ltd ·
All Rights Reserved www.marketcalls.in
Day 1 - Agenda
• Introduction to Trading System Design and Design Concepts
• Basics of Amibroker AFL Programming and Advance Looping Concepts
• Backtesting, Optimization and Key Backtesting Metrics
• Custom Backtesting, Walk Forward Testing, Monte Carlo Simulation
© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All
Rights Reserved www.marketcalls.in
Day 2 - Agenda
• Symphony Fintech on Algo Trading
• Creating Intraday Trading Strategies and Dynamic Trading Strategies
• Designing Trading System Dashboard and Alerts
• Position Sizing, Scale In and Scale Out
• Timing Models and Rotational Trading System
© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All
Rights Reserved www.marketcalls.in
What I do?
• Running a Financial Services Start-up
• Financial Blogger and Author of www.marketcalls.in since Sep 2007
• Passionate About Trading Analytics and Systems.
• System Trader.
• More www.marketcalls.in/about
© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All
Rights Reserved www.marketcalls.in
INTRODUCTION
Introduction to Trading System Design
And Design Concepts
© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All
Rights Reserved www.marketcalls.in
COMPONENTS OF TRADING SYSTEM
Trade
Data
Volatility
Trading
Software
Trading
Rules
Emotions
Testing &
Validation
Risk
Control
Market
Participants
Position
Sizing
© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All
Rights Reserved www.marketcalls.in
What Kind of Trader You are?
• Intraday Trader
• Positional Trader
• Short Term
• Medium Term
• Long Term
© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All
Rights Reserved www.marketcalls.in
What Matters
• Emotional Quotient
• Your Belief about your Trading System
• Quality Data feed
• Stable Trading Solution
• Low Cost Brokerage
• Lower Impact Cost
• Better Money Management
© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All
Rights Reserved www.marketcalls.in
Trading Software
• Amibroker
• Ninjatrader
• Multicharts, Multicharts.Net
• Esignal
• Metastock
• Metatrader
• Wealth-Lab Pro
© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All
Rights Reserved www.marketcalls.in
Free Data Providers for Amibroker
© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All
Rights Reserved www.marketcalls.in
Google Finance
(EOD, Intraday)
Yahoo Finance
(EOD, Intraday,
Fundamental)
ASCII
(csv, txt)
MSN Money
(EOD)
Quandl
(EOD)
Authorized Data Vendors for Amibroker
© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All
Rights Reserved www.marketcalls.in
Globaldatafeeds Neotradeanalytics
Esignal
(Platform + Data
feed)
True Data
Interactive Brokers
(Brokerage + Data
feed )
Type of Trading System
• Mechanical Trading System – Absolutely No Human Decision Making
- Trend Following
- Mean Reversion
- Statistical Arbitrage
• Discretionary Trading System – Human Decision Making Involved
© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All
Rights Reserved www.marketcalls.in
Disadvantages of Trend Following
• Always Lagging the trend
• Whipsaws even in Trending Market
• Loss Making in Sideways Market
• Extreme Volatility is Dangerous for Trend Following
© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All
Rights Reserved www.marketcalls.in
Disadvantages of Mean Reversion
• Extreme Volatility
• Unlimited Downside
© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All
Rights Reserved www.marketcalls.in
Stages in Trading System Design
Analysis
Design
ImplementTesting
Evaluate
© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All
Rights Reserved www.marketcalls.in
SYSTEM HEALTH
Time
Drawdown
Confidence
© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All
Rights Reserved www.marketcalls.in
Equity Curve
© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All
Rights Reserved www.marketcalls.in
Drawdown
© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All
Rights Reserved www.marketcalls.in
Why Not to Loose More Money
© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All
Rights Reserved www.marketcalls.in
SYSTEM EXPECTANCY
Helps to understand how winners, losers, gains and losses relate to
each other over the long term.
Expectancy = (Win Ratio * Average Win) - (Loss Ratio * Average Loss)
© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All
Rights Reserved www.marketcalls.in
LISTEN TO VOLATILITY
© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All
Rights Reserved www.marketcalls.in
Listen To Market Dynamics (Discretionary)
• Volatility
• Market Participants
• Macro Economics
• Currency
• Commodities
• Global Market Sentiments
© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All
Rights Reserved www.marketcalls.in
Trading System Adoption
© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All
Rights Reserved www.marketcalls.in
Trading System Once Broken is
Broken
Don’t Try to Fix it!
© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All
Rights Reserved www.marketcalls.in
Aware About Unseen Risk
Try to Avoid!
© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All
Rights Reserved www.marketcalls.in
Beware of Stop Hunting
A strategy that attempts to force some market participants out of their positions by
driving the price of an asset to a level where many individuals have chosen to set their
stop-loss orders. - investopedia
© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All
Rights Reserved www.marketcalls.in
Mid Day Stop Hunting
• Most of the Days 50% of Volume Happens in first or last 30min
• Liquidity Dry Up during mid of the day
• Very less volume is required to move the stock during mid-day
• Weak Longs/Short Removed from the Market
© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All
Rights Reserved www.marketcalls.in
A trader always has too much
size on when wrong, too little
on when right.
Avoid Too Much of Leveraged
Positions
© Copyright 2015 Marketcalls Financial Services Pvt Ltd · All
Rights Reserved www.marketcalls.in

Trading System Design

  • 1.
    AFL 2015 Amibroker AFLProgramming Workshop Bangalore © Copyright 2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in
  • 2.
    Day 1 -Agenda • Introduction to Trading System Design and Design Concepts • Basics of Amibroker AFL Programming and Advance Looping Concepts • Backtesting, Optimization and Key Backtesting Metrics • Custom Backtesting, Walk Forward Testing, Monte Carlo Simulation © Copyright 2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in
  • 3.
    Day 2 -Agenda • Symphony Fintech on Algo Trading • Creating Intraday Trading Strategies and Dynamic Trading Strategies • Designing Trading System Dashboard and Alerts • Position Sizing, Scale In and Scale Out • Timing Models and Rotational Trading System © Copyright 2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in
  • 4.
    What I do? •Running a Financial Services Start-up • Financial Blogger and Author of www.marketcalls.in since Sep 2007 • Passionate About Trading Analytics and Systems. • System Trader. • More www.marketcalls.in/about © Copyright 2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in
  • 5.
    INTRODUCTION Introduction to TradingSystem Design And Design Concepts © Copyright 2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in
  • 6.
    COMPONENTS OF TRADINGSYSTEM Trade Data Volatility Trading Software Trading Rules Emotions Testing & Validation Risk Control Market Participants Position Sizing © Copyright 2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in
  • 7.
    What Kind ofTrader You are? • Intraday Trader • Positional Trader • Short Term • Medium Term • Long Term © Copyright 2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in
  • 8.
    What Matters • EmotionalQuotient • Your Belief about your Trading System • Quality Data feed • Stable Trading Solution • Low Cost Brokerage • Lower Impact Cost • Better Money Management © Copyright 2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in
  • 9.
    Trading Software • Amibroker •Ninjatrader • Multicharts, Multicharts.Net • Esignal • Metastock • Metatrader • Wealth-Lab Pro © Copyright 2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in
  • 10.
    Free Data Providersfor Amibroker © Copyright 2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in Google Finance (EOD, Intraday) Yahoo Finance (EOD, Intraday, Fundamental) ASCII (csv, txt) MSN Money (EOD) Quandl (EOD)
  • 11.
    Authorized Data Vendorsfor Amibroker © Copyright 2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in Globaldatafeeds Neotradeanalytics Esignal (Platform + Data feed) True Data Interactive Brokers (Brokerage + Data feed )
  • 12.
    Type of TradingSystem • Mechanical Trading System – Absolutely No Human Decision Making - Trend Following - Mean Reversion - Statistical Arbitrage • Discretionary Trading System – Human Decision Making Involved © Copyright 2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in
  • 13.
    Disadvantages of TrendFollowing • Always Lagging the trend • Whipsaws even in Trending Market • Loss Making in Sideways Market • Extreme Volatility is Dangerous for Trend Following © Copyright 2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in
  • 14.
    Disadvantages of MeanReversion • Extreme Volatility • Unlimited Downside © Copyright 2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in
  • 15.
    Stages in TradingSystem Design Analysis Design ImplementTesting Evaluate © Copyright 2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in
  • 16.
    SYSTEM HEALTH Time Drawdown Confidence © Copyright2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in
  • 17.
    Equity Curve © Copyright2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in
  • 18.
    Drawdown © Copyright 2015Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in
  • 19.
    Why Not toLoose More Money © Copyright 2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in
  • 20.
    SYSTEM EXPECTANCY Helps tounderstand how winners, losers, gains and losses relate to each other over the long term. Expectancy = (Win Ratio * Average Win) - (Loss Ratio * Average Loss) © Copyright 2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in
  • 21.
    LISTEN TO VOLATILITY ©Copyright 2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in
  • 22.
    Listen To MarketDynamics (Discretionary) • Volatility • Market Participants • Macro Economics • Currency • Commodities • Global Market Sentiments © Copyright 2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in
  • 23.
    Trading System Adoption ©Copyright 2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in
  • 24.
    Trading System OnceBroken is Broken Don’t Try to Fix it! © Copyright 2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in
  • 25.
    Aware About UnseenRisk Try to Avoid! © Copyright 2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in
  • 26.
    Beware of StopHunting A strategy that attempts to force some market participants out of their positions by driving the price of an asset to a level where many individuals have chosen to set their stop-loss orders. - investopedia © Copyright 2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in
  • 27.
    Mid Day StopHunting • Most of the Days 50% of Volume Happens in first or last 30min • Liquidity Dry Up during mid of the day • Very less volume is required to move the stock during mid-day • Weak Longs/Short Removed from the Market © Copyright 2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in
  • 28.
    A trader alwayshas too much size on when wrong, too little on when right. Avoid Too Much of Leveraged Positions © Copyright 2015 Marketcalls Financial Services Pvt Ltd · All Rights Reserved www.marketcalls.in