Amibroker AFL Coding
Rajandran R
www.marketcalls.in
Disclaimer
▪ TRADING FUTURES AND OPTIONS INVOLVES SUBSTANTIAL AMOUNT OF
RISK OF LOSS AND IS NOT SUITABLE FOR ALL INVESTORS
▪ PAST PERFORMANCE IS NOT NECESSARILY INDICATIVE OF FUTURE
RESULTS.
▪ AMIBROKER IS REGISTEREDTRADEMARK OF AMIBROKER.COM.
▪ WE ARE NEITHER ASSOCIATED WITHTHE ABOVETRADEMARK OWNERS
NOR DOWE REPRESENT THEM IN ANY MANNER. WE ARE NOT OFFERING
AMIBROKER PLATFORM FOR SALE ON OURWEBSITE / IN OUR OFFICE.
www.marketcalls.in Customer Support : 09738383344
About Me
▪ Running a Financial Start-up
▪ Author of www.marketcalls.in since Sep 2007
▪ Trading System Designer
▪ SystemTrader & Financial Blogger
▪ More www.marketcalls.in/about
www.marketcalls.in Customer Support : 09738383344
No Subjective Interpretation
▪ NoTrend Lines
▪ No Gann
▪ No Fibonacci
▪ No Elliot wave
▪ NoTrading Patterns
▪ No Divergence
▪ No News
▪ No Fundamentals
www.marketcalls.in Customer Support : 09738383344
Trading Analysis Software
Amibroker Metastock Ninjatrader
Esignal Multicharts
www.marketcalls.in Customer Support : 09738383344
Free Data Providers for Amibroker
Google Finance
(EOD, Intraday)
Yahoo Finance
(EOD, Intraday,
Fundamental)
ASCII
(csv, txt)
MSN Money
(EOD)
Quandl
(EOD)
www.marketcalls.in Customer Support : 09738383344
Subscription based Data Providers
Globaldatafeeds Neotradeanalytics
Esignal
(Platform + Data
feed)
DTN IQFeed
Interactive Brokers
(Brokerage + Data
feed )
CQG
www.marketcalls.in Customer Support : 09738383344
Why Amibroker?
▪ Ease of Use
▪ High Speed Execution
▪ Supports Autotrading (Symphony Fintech, Interactive Brokers)
▪ CustomTimeframe
▪ MultiTimeframe Support
▪ Backtesting Optimization Walk ForwardTesting
▪ Scanning and Exploration
▪ Custom Indicators (AFL Programming)
www.marketcalls.in Customer Support : 09738383344
Amibroker Formula Language (AFL)
www.marketcalls.in Customer Support : 09738383344
▪ AFL is Vector Programming Language
▪ Write your own Custom Indicators, Scanners, Exploration and custom
commentaries
▪ Write your ownTrading System Rules
AFL Tokens
▪ Identifiers
▪ Constants
▪ String – literals
▪ Operators
▪ Punctuators (Separators)
www.marketcalls.in Customer Support : 09738383344
Built-in Identifiers
Identifiers Abbreviation
Open O
High H
Low L
Close C
Volume V
OpenInt OI
Avg
www.marketcalls.in Customer Support : 09738383344
Comparison Operators
Symbol Meaning
< Less than
> Greater than
<= Less than or equal to
>= Greater than or equal to
== Equal to
! Not
!= Not Equal to
www.marketcalls.in Customer Support : 09738383344
Arithmetic and Logical Operators
Symbol Meaning
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulus
^ Exponentiation
| & BitwiseOR BitwiseAND
www.marketcalls.in Customer Support : 09738383344
Symbol Meaning
NOT Logical NOT
AND LogicalAND
OR Logical OR
Sample Built-in Functions
▪ RSI(14) - 14 period RSI
▪ MACD() - Default MACD
▪ EMA(c,10) - 10 period EMA
▪ Ref(C, -1 ) - Previous Close Array
▪ MA(C,25) - 25 period Simple MA
▪ Cross(C, EMA(c10)) - Crossover Functions
▪ Barindex() - returns total number of bars (similar to Barcount)
More at http://www.amibroker.com/guide/a_funref.html
www.marketcalls.in Customer Support : 09738383344
Understanding Arrays
www.marketcalls.in Customer Support : 09738383344
AFL Arrays Example 1
www.marketcalls.in Customer Support : 09738383344
Day
1 2 3 4 5 6 7 8 9 10
1 Open 123 124 121 126 124 129 133 132 135 137
2 High 124 127 125 129 125 129 135 135 137 129
3 Low 120 121 119 120 121 124 130 128 131 127
4 Close 123 126 124 128 125 125 131 130 132 128
5 Volume 8310 3021 5325 2834 1432 5666 7847 555 6749 3456
6 Ref(C-1) NULL 123 126 124 128 125 125 131 130 132
Pattern Detection Functions
▪ Inside()
▪ Outside()
▪ GapUp()
▪ GapDown()
Gives a "1" or “True” when a
inside Pattern occurs.
Gives "0" or “False” otherwise.
www.marketcalls.in Customer Support : 09738383344
Plot Functions
▪ Plot()
▪ PlotOHLC()
▪ PlotShapes()
Demo
www.marketcalls.in Customer Support : 09738383344
Plot Arrows
/* Plot Buy and Sell SignalArrows */
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-50);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);
PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);
www.marketcalls.in Customer Support : 09738383344
AFL Arrays Example 2
www.marketcalls.in Customer Support : 09738383344
Day
1 2 3 4 5 6 7 8 9 10
1 Open 123 124 121 126 124 129 133 132 135 137
2 BeginValue( Open ) 124 124 124 124 124 124 124 124 124 124
3 EndValue( Open ) 132 132 132 132 132 132 132 132 132 132
4 SelectedValue(Open ) 121 121 121 121 121 121 121 121 121 121
5 LastValue( Open ) 137 137 137 137 137 137 137 137 137 137
6 Close 122 126 123 128 125 125 131 130 132 128
Lowest/Highest Functions
▪ LLV()
▪ HHV()
▪ Lowest()
▪ Highest()
▪ LLV(C,10)
▪ HHV(c,10)
▪ Lowest( RSI(14))
▪ Highest( MFI(14) )
DEMO
www.marketcalls.in Customer Support : 09738383344
Alerts (in built and 3rd Party)
▪ SoundAlert
▪ Voice Alert
▪ Email Alert
▪ Alertif() , say() functions
▪ Twitter Alert [tweetymail]
▪ Trade Sender
▪ Push Bullet [http api]
www.marketcalls.in Customer Support : 09738383344
Param Control Functions
▪ Param()
▪ Paramcolor()
▪ Paramstr()
▪ ParamTime()
▪ ParamDate()
▪ ParamField()
▪ ParamTrigger()
▪ ParamList()
▪ ParamToggle()
▪ ParamStyle()
DEMO
www.marketcalls.in Customer Support : 09738383344
Built-in Trading Logic Identifiers
▪ Buy
▪ Sell
▪ Short
▪ Cover
DEMO
www.marketcalls.in Customer Support : 09738383344
Simple Exploration
www.marketcalls.in Customer Support : 09738383344
Filter =1;
AddColumn(RSI(10),"RSI", 1.2);
AddColumn(EMA(C,10),"EMA10",1.2);
AddColumn(v,"volume",1);
Understanding different IF Functions
▪ IF
▪ IIF
▪ WriteIF
▪ If(buy[barcount-1] == true)
▪ Color =
iif(RSI(14)>70,colorgreen,colorred)
www.marketcalls.in Customer Support : 09738383344
Multitimeframe Functions
SwitchingTimeframe
• TimeFrameSet
• TimeFrameRestore
Compress/Expand
• TimeFrameCompress
• TimeFrameExpand
Access DiffTimeframe
• TimeFrameGetPrice
www.marketcalls.in Customer Support : 09738383344
Multimeframe Getprice
TimeFrameGetPrice( "O", inWeekly, -1 ) // gives you previous week Open price
TimeFrameGetPrice( "C", inWeekly, -3 ) // gives you weekly Close price 3 weeks ago
TimeFrameGetPrice( "H", inWeekly, -2 ) // gives you weekly High price 2 weeks ago
TimeFrameGetPrice( "O", inWeekly, 0 ) // gives you this week Open price.
TimeFrameGetPrice( "H", inDaily, -1 ) // gives previous Day High when working on intraday data
www.marketcalls.in Customer Support : 09738383344
Components of Trading System
Initial
Parameters
Trading
Logic
Position
Size
Signals &
Alerts
Dashboard
www.marketcalls.in Customer Support : 09738383344
Simple Trading System
SetTradeDelays(1,1,1,1);
SetPositionSize(100,spsShares);
par1 = param("par1",10,1,50,1);
par2 = param("par2",15,1,50,1);
sema = EMA(C,par1);
lema = EMA(C,par2);
Buy = Cross(sema,lema);
Sell = Cross(lema,sema);
www.marketcalls.in Customer Support : 09738383344
Position Size & Trade Delay
▪ SetTradeDelays(1,1,1,1); //Trade Delay of 1 Bar
▪ SetPositionSize( 100, spsShares ); // 100 shares by default
▪ SetPositionSize( 10, spsPercentofEquity ); //Percentage Equity
▪ SetPositionSize( 100000, spsValue ); // Fixed Amount
http://www.amibroker.com/kb/2014/10/12/position-sizing-based-on-
risk/
www.marketcalls.in Customer Support : 09738383344
Equity Curve
www.marketcalls.in Customer Support : 09738383344
Backtesting
www.marketcalls.in Customer Support : 09738383344
Trading System Design Cycle
Analysis
Design
ImplementTesting
Evaluate
www.marketcalls.in Customer Support : 09738383344
Time Based Trading Rules
▪ Timenum() Function
▪ Mostly Rules for Intraday
DEMO
www.marketcalls.in Customer Support : 09738383344
Foreign Functions
▪ Retrieve Data from other
Symbols
DEMO
www.marketcalls.in Customer Support : 09738383344
Offers to Webinar Participants
Globaldatafeeds
▪ Take Data Subscription of NSE
MCX NSE FX
www.marketcalls.in/services
Contact Customer Support
09738383344
SupportTimings – (9a.m – 6p.m)
Mon - Fri
Tradejini ( Discount Broker )
▪ Get 50% of Brokerage Reversal
upto your purchased product
▪ Rs 20 Per Order
▪ Trade in NSE, BSE, MCX, MCX-
SX
▪ Nest/NowTradingTerminal
www.marketcalls.in Customer Support : 09738383344
Recommended Trading Books
Beginners
• Introduction to Amibroker – 2nd Edition – Howard Bandy
• Amibroker User Guide
Intermediate
• QuantitativeTrading Systems – Howard Bandy
• ModellingTrading System Performance – Howard Bandy
Experts
• Mean ReversionTrading Systems – Howard Bandy
• QuantitativeTechnical Analysis – Howard Bandy
www.marketcalls.in Customer Support : 09738383344
AFL Library & Forums
▪ Amibroker Library
www.amibroker.com/library
▪ Marketcalls Library
www.marketcalls.in/library
▪ Wisestocktrader Library
www.wisestocktrader.com
▪ AmibrokerYahoo Groups
▪ Traderji Forum
▪ Inditraders Forum
▪ Marketcalls Community
www.marketcalls.in Customer Support : 09738383344
Questions
www.marketcalls.in Customer Support : 09738383344
ThankYou
www.marketcalls.in Customer Support : 09738383344

More Related Content

PPTX
Amibroker afl coding 28th atma bengaluru meet
PDF
AmiBroker ApplyStop Introduction
PDF
Option_Greeks
PDF
Scalping strategies for Forex trading
PPTX
Batir votre étude de marché
PDF
Stop Trading Support And Resistance The Wrong Way
PDF
"Trading Strategies That Are Designed Not Fitted" by Robert Carver, Independe...
PDF
Fixed Income Trading System Architecture
Amibroker afl coding 28th atma bengaluru meet
AmiBroker ApplyStop Introduction
Option_Greeks
Scalping strategies for Forex trading
Batir votre étude de marché
Stop Trading Support And Resistance The Wrong Way
"Trading Strategies That Are Designed Not Fitted" by Robert Carver, Independe...
Fixed Income Trading System Architecture

What's hot (19)

PDF
Recetario de Productos Silvestres de Villamesías
PPTX
Algorithmic trading
PDF
Formation trading
PPTX
Algorithmic & High-Frequency Trading
PPT
Understanding Japanese Candlesticks in Forex Trading by valentino heavens
PDF
Strategie de prix
PDF
Discover the Smart Money with the Order Block Indicator & S&D indicator.pdf
PDF
Option trading strategies_book
PPTX
The Breakout in GS - The PlayBook Webinar Series
PDF
Mindfluential Trading (Session 1)....pdf
PDF
AmiBroker Custom Backtester Interface
PPT
23512555 trade-life-cycle
PDF
Marketing B to B pour praticien
PDF
Fibonacci turning points part 1
PPTX
Introducción al metódo de la acción del precio
PPTX
Forex trading strategies
PPTX
Trading divergences
PPT
Elliot wave analysis lectures @intan 1998
PDF
Option Gamma - Dynamic Delta Hedging
Recetario de Productos Silvestres de Villamesías
Algorithmic trading
Formation trading
Algorithmic & High-Frequency Trading
Understanding Japanese Candlesticks in Forex Trading by valentino heavens
Strategie de prix
Discover the Smart Money with the Order Block Indicator & S&D indicator.pdf
Option trading strategies_book
The Breakout in GS - The PlayBook Webinar Series
Mindfluential Trading (Session 1)....pdf
AmiBroker Custom Backtester Interface
23512555 trade-life-cycle
Marketing B to B pour praticien
Fibonacci turning points part 1
Introducción al metódo de la acción del precio
Forex trading strategies
Trading divergences
Elliot wave analysis lectures @intan 1998
Option Gamma - Dynamic Delta Hedging
Ad

Viewers also liked (20)

PPTX
Coimbatore amibroker workshop 2014
PPTX
Monte Carlo Simulation for Trading System in AmiBroker
DOCX
AmiBroker AFL to DLL Conversion
PDF
Understand Foreign Equity in AmiBroker
PDF
A Guide to Trading System Analysis : แนะนำแนวทางการอ่านผล Backtest เพื่อวิเคร...
PDF
AmiBroker Buy sell target & stop loss trading signals software for equity, co...
PDF
Atma sphere april 2014 (1)
PDF
Improving Your Trading Plan
PDF
SiamQuant 2.0 Discovering Alphas Annoucement : จงค้นหา แล้วจะค้นพบ! เริ่มต้นว...
PDF
Does P/E Band Really Work!? : บททดสอบกลยุทธ์การลงทุนด้วย P/E Band
PPT
Plan your trade,trade your plan
PPTX
Trading system designer
PPTX
Transition to a_hedge fund_-_wsi
PPTX
Fears, Emotions & Market Crash
PDF
Tips for Tuning Solr Search: No Coding Required
PPT
Technology Edge in Algo Trading: Traditional Vs Automated Trading System Arch...
PDF
Saral Gyan - 15% @ 90 Days - April 2016
PDF
Saral Gyan Hidden Gem - Dec 2012
PDF
Saral Gyan Hidden Gem - Sept 2014
PDF
Saral Gyan Hidden Gem - Feb 2016
Coimbatore amibroker workshop 2014
Monte Carlo Simulation for Trading System in AmiBroker
AmiBroker AFL to DLL Conversion
Understand Foreign Equity in AmiBroker
A Guide to Trading System Analysis : แนะนำแนวทางการอ่านผล Backtest เพื่อวิเคร...
AmiBroker Buy sell target & stop loss trading signals software for equity, co...
Atma sphere april 2014 (1)
Improving Your Trading Plan
SiamQuant 2.0 Discovering Alphas Annoucement : จงค้นหา แล้วจะค้นพบ! เริ่มต้นว...
Does P/E Band Really Work!? : บททดสอบกลยุทธ์การลงทุนด้วย P/E Band
Plan your trade,trade your plan
Trading system designer
Transition to a_hedge fund_-_wsi
Fears, Emotions & Market Crash
Tips for Tuning Solr Search: No Coding Required
Technology Edge in Algo Trading: Traditional Vs Automated Trading System Arch...
Saral Gyan - 15% @ 90 Days - April 2016
Saral Gyan Hidden Gem - Dec 2012
Saral Gyan Hidden Gem - Sept 2014
Saral Gyan Hidden Gem - Feb 2016
Ad

Similar to Amibroker AFL Coding - Webinar (20)

PDF
TMPA-2017: Defect Report Classification in Accordance with Areas of Testing
PDF
Increasing reporting value with statistics
PPTX
Quantitative finance 101
PPTX
Quantitative finance 101
PDF
Testing trading strategies in JavaScript
PDF
Speed of Lightning
PDF
Rebuilding the Busiest Trading Exchange in the World to Scale 10X (Manjunath ...
PDF
Ncdex tips
PDF
, NCDEX POSITIONAL TIPS
PDF
Algo trading(Minor Project) strategy EMA with Ipython
PDF
Trading decision trees ( Elaborated by Mohamed DHAOUI )
PDF
Business Valuation PowerPoint Presentation Slides
PPT
This Help you for Earning
PPT
StrikeZone-01
PPT
A G S006 Little 091807
PDF
How To Forex trade with sucess - Caliber FX Pro - System Manual
PPTX
Vertical Recommendation Using Collaborative Filtering
PDF
7 Habits of Highly Efficient Visualforce Pages
PDF
Business Valuation Powerpoint Presentation Slides
PDF
Daily Derivative Report
TMPA-2017: Defect Report Classification in Accordance with Areas of Testing
Increasing reporting value with statistics
Quantitative finance 101
Quantitative finance 101
Testing trading strategies in JavaScript
Speed of Lightning
Rebuilding the Busiest Trading Exchange in the World to Scale 10X (Manjunath ...
Ncdex tips
, NCDEX POSITIONAL TIPS
Algo trading(Minor Project) strategy EMA with Ipython
Trading decision trees ( Elaborated by Mohamed DHAOUI )
Business Valuation PowerPoint Presentation Slides
This Help you for Earning
StrikeZone-01
A G S006 Little 091807
How To Forex trade with sucess - Caliber FX Pro - System Manual
Vertical Recommendation Using Collaborative Filtering
7 Habits of Highly Efficient Visualforce Pages
Business Valuation Powerpoint Presentation Slides
Daily Derivative Report

More from Marketcalls (20)

PPTX
Trading API and Automation – Quantageddon 2.0 @ IIT Chennai
PPTX
OpenAlgo - Algotrading Platform for Everyone
PPTX
Python for Traders - Introduction to Python for Trading
PPTX
Line Trading Automation - Algomojo Amibroker Module
PPTX
Introduction to Option Greeks
PDF
New margin requirement for popular futures and options strategies
PPTX
Tradestudio 5.0 - Documentation
PDF
Trading Money on 2nd OCT 2019 - Market Outlook
PPTX
Trading money on 22nd sep 2019
PPTX
Budget 2019 - Nifty Futures Intraday Price Action
PPTX
Trading options and market profile
PPTX
Custom Algo Development - Marketcalls
PPTX
Tradezilla 2.0 - Discover Your Trading Edge Using Market Profile and Orderflow
PPTX
Trading Strategies for Active Traders
PDF
Marketcalls slack 24th dec 2018
PPTX
Introduction to Algoaction -Web Based Trading Platform
PPTX
Amibroker Fast Track Course Bangalore
PPTX
Market profile - ATMA 42nd Educational Meeting
PPTX
LinTRA – Intraday Trading System
PPTX
TradeZilla - Trading system Design
Trading API and Automation – Quantageddon 2.0 @ IIT Chennai
OpenAlgo - Algotrading Platform for Everyone
Python for Traders - Introduction to Python for Trading
Line Trading Automation - Algomojo Amibroker Module
Introduction to Option Greeks
New margin requirement for popular futures and options strategies
Tradestudio 5.0 - Documentation
Trading Money on 2nd OCT 2019 - Market Outlook
Trading money on 22nd sep 2019
Budget 2019 - Nifty Futures Intraday Price Action
Trading options and market profile
Custom Algo Development - Marketcalls
Tradezilla 2.0 - Discover Your Trading Edge Using Market Profile and Orderflow
Trading Strategies for Active Traders
Marketcalls slack 24th dec 2018
Introduction to Algoaction -Web Based Trading Platform
Amibroker Fast Track Course Bangalore
Market profile - ATMA 42nd Educational Meeting
LinTRA – Intraday Trading System
TradeZilla - Trading system Design

Recently uploaded (20)

PPT
Lecture notes on Business Research Methods
PDF
533158074-Saudi-Arabia-Companies-List-Contact.pdf
PDF
Satish NS: Fostering Innovation and Sustainability: Haier India’s Customer-Ce...
PDF
Introduction to Generative Engine Optimization (GEO)
PDF
1911 Gold Corporate Presentation Aug 2025.pdf
PPTX
BUSINESS CYCLE_INFLATION AND UNEMPLOYMENT.pptx
PDF
ICv2 White Paper - Gen Con Trade Day 2025
PDF
Susan Semmelmann: Enriching the Lives of others through her Talents and Bless...
PDF
Solaris Resources Presentation - Corporate August 2025.pdf
PDF
Charisse Litchman: A Maverick Making Neurological Care More Accessible
PPTX
Slide gioi thieu VietinBank Quy 2 - 2025
PDF
Daniels 2024 Inclusive, Sustainable Development
PPTX
chapter 2 entrepreneurship full lecture ppt
PPTX
basic introduction to research chapter 1.pptx
PDF
#1 Safe and Secure Verified Cash App Accounts for Purchase.pdf
PPT
Lecture 3344;;,,(,(((((((((((((((((((((((
PDF
income tax laws notes important pakistan
PDF
Ron Thomas - Top Influential Business Leaders Shaping the Modern Industry – 2025
PPTX
Board-Reporting-Package-by-Umbrex-5-23-23.pptx
PDF
Robin Fischer: A Visionary Leader Making a Difference in Healthcare, One Day ...
Lecture notes on Business Research Methods
533158074-Saudi-Arabia-Companies-List-Contact.pdf
Satish NS: Fostering Innovation and Sustainability: Haier India’s Customer-Ce...
Introduction to Generative Engine Optimization (GEO)
1911 Gold Corporate Presentation Aug 2025.pdf
BUSINESS CYCLE_INFLATION AND UNEMPLOYMENT.pptx
ICv2 White Paper - Gen Con Trade Day 2025
Susan Semmelmann: Enriching the Lives of others through her Talents and Bless...
Solaris Resources Presentation - Corporate August 2025.pdf
Charisse Litchman: A Maverick Making Neurological Care More Accessible
Slide gioi thieu VietinBank Quy 2 - 2025
Daniels 2024 Inclusive, Sustainable Development
chapter 2 entrepreneurship full lecture ppt
basic introduction to research chapter 1.pptx
#1 Safe and Secure Verified Cash App Accounts for Purchase.pdf
Lecture 3344;;,,(,(((((((((((((((((((((((
income tax laws notes important pakistan
Ron Thomas - Top Influential Business Leaders Shaping the Modern Industry – 2025
Board-Reporting-Package-by-Umbrex-5-23-23.pptx
Robin Fischer: A Visionary Leader Making a Difference in Healthcare, One Day ...

Amibroker AFL Coding - Webinar

  • 1. Amibroker AFL Coding Rajandran R www.marketcalls.in
  • 2. Disclaimer ▪ TRADING FUTURES AND OPTIONS INVOLVES SUBSTANTIAL AMOUNT OF RISK OF LOSS AND IS NOT SUITABLE FOR ALL INVESTORS ▪ PAST PERFORMANCE IS NOT NECESSARILY INDICATIVE OF FUTURE RESULTS. ▪ AMIBROKER IS REGISTEREDTRADEMARK OF AMIBROKER.COM. ▪ WE ARE NEITHER ASSOCIATED WITHTHE ABOVETRADEMARK OWNERS NOR DOWE REPRESENT THEM IN ANY MANNER. WE ARE NOT OFFERING AMIBROKER PLATFORM FOR SALE ON OURWEBSITE / IN OUR OFFICE. www.marketcalls.in Customer Support : 09738383344
  • 3. About Me ▪ Running a Financial Start-up ▪ Author of www.marketcalls.in since Sep 2007 ▪ Trading System Designer ▪ SystemTrader & Financial Blogger ▪ More www.marketcalls.in/about www.marketcalls.in Customer Support : 09738383344
  • 4. No Subjective Interpretation ▪ NoTrend Lines ▪ No Gann ▪ No Fibonacci ▪ No Elliot wave ▪ NoTrading Patterns ▪ No Divergence ▪ No News ▪ No Fundamentals www.marketcalls.in Customer Support : 09738383344
  • 5. Trading Analysis Software Amibroker Metastock Ninjatrader Esignal Multicharts www.marketcalls.in Customer Support : 09738383344
  • 6. Free Data Providers for Amibroker Google Finance (EOD, Intraday) Yahoo Finance (EOD, Intraday, Fundamental) ASCII (csv, txt) MSN Money (EOD) Quandl (EOD) www.marketcalls.in Customer Support : 09738383344
  • 7. Subscription based Data Providers Globaldatafeeds Neotradeanalytics Esignal (Platform + Data feed) DTN IQFeed Interactive Brokers (Brokerage + Data feed ) CQG www.marketcalls.in Customer Support : 09738383344
  • 8. Why Amibroker? ▪ Ease of Use ▪ High Speed Execution ▪ Supports Autotrading (Symphony Fintech, Interactive Brokers) ▪ CustomTimeframe ▪ MultiTimeframe Support ▪ Backtesting Optimization Walk ForwardTesting ▪ Scanning and Exploration ▪ Custom Indicators (AFL Programming) www.marketcalls.in Customer Support : 09738383344
  • 9. Amibroker Formula Language (AFL) www.marketcalls.in Customer Support : 09738383344 ▪ AFL is Vector Programming Language ▪ Write your own Custom Indicators, Scanners, Exploration and custom commentaries ▪ Write your ownTrading System Rules
  • 10. AFL Tokens ▪ Identifiers ▪ Constants ▪ String – literals ▪ Operators ▪ Punctuators (Separators) www.marketcalls.in Customer Support : 09738383344
  • 11. Built-in Identifiers Identifiers Abbreviation Open O High H Low L Close C Volume V OpenInt OI Avg www.marketcalls.in Customer Support : 09738383344
  • 12. Comparison Operators Symbol Meaning < Less than > Greater than <= Less than or equal to >= Greater than or equal to == Equal to ! Not != Not Equal to www.marketcalls.in Customer Support : 09738383344
  • 13. Arithmetic and Logical Operators Symbol Meaning + Addition - Subtraction * Multiplication / Division % Modulus ^ Exponentiation | & BitwiseOR BitwiseAND www.marketcalls.in Customer Support : 09738383344 Symbol Meaning NOT Logical NOT AND LogicalAND OR Logical OR
  • 14. Sample Built-in Functions ▪ RSI(14) - 14 period RSI ▪ MACD() - Default MACD ▪ EMA(c,10) - 10 period EMA ▪ Ref(C, -1 ) - Previous Close Array ▪ MA(C,25) - 25 period Simple MA ▪ Cross(C, EMA(c10)) - Crossover Functions ▪ Barindex() - returns total number of bars (similar to Barcount) More at http://www.amibroker.com/guide/a_funref.html www.marketcalls.in Customer Support : 09738383344
  • 16. AFL Arrays Example 1 www.marketcalls.in Customer Support : 09738383344 Day 1 2 3 4 5 6 7 8 9 10 1 Open 123 124 121 126 124 129 133 132 135 137 2 High 124 127 125 129 125 129 135 135 137 129 3 Low 120 121 119 120 121 124 130 128 131 127 4 Close 123 126 124 128 125 125 131 130 132 128 5 Volume 8310 3021 5325 2834 1432 5666 7847 555 6749 3456 6 Ref(C-1) NULL 123 126 124 128 125 125 131 130 132
  • 17. Pattern Detection Functions ▪ Inside() ▪ Outside() ▪ GapUp() ▪ GapDown() Gives a "1" or “True” when a inside Pattern occurs. Gives "0" or “False” otherwise. www.marketcalls.in Customer Support : 09738383344
  • 18. Plot Functions ▪ Plot() ▪ PlotOHLC() ▪ PlotShapes() Demo www.marketcalls.in Customer Support : 09738383344
  • 19. Plot Arrows /* Plot Buy and Sell SignalArrows */ PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40); PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-50); PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45); PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset=40); PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50); PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45); www.marketcalls.in Customer Support : 09738383344
  • 20. AFL Arrays Example 2 www.marketcalls.in Customer Support : 09738383344 Day 1 2 3 4 5 6 7 8 9 10 1 Open 123 124 121 126 124 129 133 132 135 137 2 BeginValue( Open ) 124 124 124 124 124 124 124 124 124 124 3 EndValue( Open ) 132 132 132 132 132 132 132 132 132 132 4 SelectedValue(Open ) 121 121 121 121 121 121 121 121 121 121 5 LastValue( Open ) 137 137 137 137 137 137 137 137 137 137 6 Close 122 126 123 128 125 125 131 130 132 128
  • 21. Lowest/Highest Functions ▪ LLV() ▪ HHV() ▪ Lowest() ▪ Highest() ▪ LLV(C,10) ▪ HHV(c,10) ▪ Lowest( RSI(14)) ▪ Highest( MFI(14) ) DEMO www.marketcalls.in Customer Support : 09738383344
  • 22. Alerts (in built and 3rd Party) ▪ SoundAlert ▪ Voice Alert ▪ Email Alert ▪ Alertif() , say() functions ▪ Twitter Alert [tweetymail] ▪ Trade Sender ▪ Push Bullet [http api] www.marketcalls.in Customer Support : 09738383344
  • 23. Param Control Functions ▪ Param() ▪ Paramcolor() ▪ Paramstr() ▪ ParamTime() ▪ ParamDate() ▪ ParamField() ▪ ParamTrigger() ▪ ParamList() ▪ ParamToggle() ▪ ParamStyle() DEMO www.marketcalls.in Customer Support : 09738383344
  • 24. Built-in Trading Logic Identifiers ▪ Buy ▪ Sell ▪ Short ▪ Cover DEMO www.marketcalls.in Customer Support : 09738383344
  • 25. Simple Exploration www.marketcalls.in Customer Support : 09738383344 Filter =1; AddColumn(RSI(10),"RSI", 1.2); AddColumn(EMA(C,10),"EMA10",1.2); AddColumn(v,"volume",1);
  • 26. Understanding different IF Functions ▪ IF ▪ IIF ▪ WriteIF ▪ If(buy[barcount-1] == true) ▪ Color = iif(RSI(14)>70,colorgreen,colorred) www.marketcalls.in Customer Support : 09738383344
  • 27. Multitimeframe Functions SwitchingTimeframe • TimeFrameSet • TimeFrameRestore Compress/Expand • TimeFrameCompress • TimeFrameExpand Access DiffTimeframe • TimeFrameGetPrice www.marketcalls.in Customer Support : 09738383344
  • 28. Multimeframe Getprice TimeFrameGetPrice( "O", inWeekly, -1 ) // gives you previous week Open price TimeFrameGetPrice( "C", inWeekly, -3 ) // gives you weekly Close price 3 weeks ago TimeFrameGetPrice( "H", inWeekly, -2 ) // gives you weekly High price 2 weeks ago TimeFrameGetPrice( "O", inWeekly, 0 ) // gives you this week Open price. TimeFrameGetPrice( "H", inDaily, -1 ) // gives previous Day High when working on intraday data www.marketcalls.in Customer Support : 09738383344
  • 29. Components of Trading System Initial Parameters Trading Logic Position Size Signals & Alerts Dashboard www.marketcalls.in Customer Support : 09738383344
  • 30. Simple Trading System SetTradeDelays(1,1,1,1); SetPositionSize(100,spsShares); par1 = param("par1",10,1,50,1); par2 = param("par2",15,1,50,1); sema = EMA(C,par1); lema = EMA(C,par2); Buy = Cross(sema,lema); Sell = Cross(lema,sema); www.marketcalls.in Customer Support : 09738383344
  • 31. Position Size & Trade Delay ▪ SetTradeDelays(1,1,1,1); //Trade Delay of 1 Bar ▪ SetPositionSize( 100, spsShares ); // 100 shares by default ▪ SetPositionSize( 10, spsPercentofEquity ); //Percentage Equity ▪ SetPositionSize( 100000, spsValue ); // Fixed Amount http://www.amibroker.com/kb/2014/10/12/position-sizing-based-on- risk/ www.marketcalls.in Customer Support : 09738383344
  • 34. Trading System Design Cycle Analysis Design ImplementTesting Evaluate www.marketcalls.in Customer Support : 09738383344
  • 35. Time Based Trading Rules ▪ Timenum() Function ▪ Mostly Rules for Intraday DEMO www.marketcalls.in Customer Support : 09738383344
  • 36. Foreign Functions ▪ Retrieve Data from other Symbols DEMO www.marketcalls.in Customer Support : 09738383344
  • 37. Offers to Webinar Participants Globaldatafeeds ▪ Take Data Subscription of NSE MCX NSE FX www.marketcalls.in/services Contact Customer Support 09738383344 SupportTimings – (9a.m – 6p.m) Mon - Fri Tradejini ( Discount Broker ) ▪ Get 50% of Brokerage Reversal upto your purchased product ▪ Rs 20 Per Order ▪ Trade in NSE, BSE, MCX, MCX- SX ▪ Nest/NowTradingTerminal www.marketcalls.in Customer Support : 09738383344
  • 38. Recommended Trading Books Beginners • Introduction to Amibroker – 2nd Edition – Howard Bandy • Amibroker User Guide Intermediate • QuantitativeTrading Systems – Howard Bandy • ModellingTrading System Performance – Howard Bandy Experts • Mean ReversionTrading Systems – Howard Bandy • QuantitativeTechnical Analysis – Howard Bandy www.marketcalls.in Customer Support : 09738383344
  • 39. AFL Library & Forums ▪ Amibroker Library www.amibroker.com/library ▪ Marketcalls Library www.marketcalls.in/library ▪ Wisestocktrader Library www.wisestocktrader.com ▪ AmibrokerYahoo Groups ▪ Traderji Forum ▪ Inditraders Forum ▪ Marketcalls Community www.marketcalls.in Customer Support : 09738383344