Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Amibroker AFL Coding - Webinar

4,726 views

Published on

Amibroker AFL Coding Webinar - 7th March 2015

Published in: Business
  • I like this service ⇒ www.HelpWriting.net ⇐ from Academic Writers. I don't have enough time write it by myself.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • The final result was amazing, and I highly recommend ⇒ www.HelpWriting.net ⇐ to anyone in the same mindset as me.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Really Enjoy this Article. Find out more advance here | pipschart.com/amibroker-afl-code/
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Dating for everyone is here: ♥♥♥ http://bit.ly/2F90ZZC ♥♥♥
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Follow the link, new dating source: ❶❶❶ http://bit.ly/2F90ZZC ❶❶❶
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Amibroker AFL Coding - Webinar

  1. 1. Amibroker AFL Coding Rajandran R www.marketcalls.in
  2. 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. 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. 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. 5. Trading Analysis Software Amibroker Metastock Ninjatrader Esignal Multicharts www.marketcalls.in Customer Support : 09738383344
  6. 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. 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. 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. 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. 10. AFL Tokens ▪ Identifiers ▪ Constants ▪ String – literals ▪ Operators ▪ Punctuators (Separators) www.marketcalls.in Customer Support : 09738383344
  11. 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. 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. 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. 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
  15. 15. Understanding Arrays www.marketcalls.in Customer Support : 09738383344
  16. 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. 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. 18. Plot Functions ▪ Plot() ▪ PlotOHLC() ▪ PlotShapes() Demo www.marketcalls.in Customer Support : 09738383344
  19. 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. 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. 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. 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. 23. Param Control Functions ▪ Param() ▪ Paramcolor() ▪ Paramstr() ▪ ParamTime() ▪ ParamDate() ▪ ParamField() ▪ ParamTrigger() ▪ ParamList() ▪ ParamToggle() ▪ ParamStyle() DEMO www.marketcalls.in Customer Support : 09738383344
  24. 24. Built-in Trading Logic Identifiers ▪ Buy ▪ Sell ▪ Short ▪ Cover DEMO www.marketcalls.in Customer Support : 09738383344
  25. 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. 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. 27. Multitimeframe Functions SwitchingTimeframe • TimeFrameSet • TimeFrameRestore Compress/Expand • TimeFrameCompress • TimeFrameExpand Access DiffTimeframe • TimeFrameGetPrice www.marketcalls.in Customer Support : 09738383344
  28. 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. 29. Components of Trading System Initial Parameters Trading Logic Position Size Signals & Alerts Dashboard www.marketcalls.in Customer Support : 09738383344
  30. 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. 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
  32. 32. Equity Curve www.marketcalls.in Customer Support : 09738383344
  33. 33. Backtesting www.marketcalls.in Customer Support : 09738383344
  34. 34. Trading System Design Cycle Analysis Design ImplementTesting Evaluate www.marketcalls.in Customer Support : 09738383344
  35. 35. Time Based Trading Rules ▪ Timenum() Function ▪ Mostly Rules for Intraday DEMO www.marketcalls.in Customer Support : 09738383344
  36. 36. Foreign Functions ▪ Retrieve Data from other Symbols DEMO www.marketcalls.in Customer Support : 09738383344
  37. 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. 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. 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
  40. 40. Questions www.marketcalls.in Customer Support : 09738383344
  41. 41. ThankYou www.marketcalls.in Customer Support : 09738383344

×