Successful Algorithmic Trading - Original PDF

دانلود کتاب Successful Algorithmic Trading - Original PDF

Author: Michael Halls Moore

0 (0)

توضیحات کتاب :

Whether the systematic rules codied by the strategy actually produce a consistent return and whether the strategy possesses positive performance in the backtests. ˆ Whether a strategy maintains this positive performance in a live implementation or whether it needs to be retired. ˆ The ability to compare multiple strategies/portfolios such that we can reduce the opportu- nity cost associated with allocating a limited amount of trading capital. The particular items of quantitative analysis of performance that we will be interested in are as follows: ˆ Returns - The most visible aspect of a trading strategy concerns the percentage gain since inception, either in a backtest or a live trading environment. The two major performance measures here are Total Return and Compound Annual Growth Rate (CAGR). ˆ Drawdowns - A drawdown is a period of negative performance, as dened from a prior high-water mark, itself dened as the previous highest peak on a strategy or portfolio equity curve. We will dene this more concretely below, but you can think of it for now as a (somewhat painful!) downward slope on your performance chart. ˆ Risk - Risk comprises many areas, and we'll spend signicant time going over them in the following chapter, but generally it refers to both risk of capital loss, such as with drawdowns, and volatility of returns. The latter usually being calculated as an annualised standard deviation of returns. ˆ Risk/Reward Ratio - Institutional investors are mainly interested with risk-adjusted returns. Since higher volatility can often lead to higher returns at the expense of greate

سرچ در وردکت | سرچ در گودریدز | سرچ در اب بوکز | سرچ در آمازون | سرچ در گوگل بوک

523 بازدید 0 خرید

ضمانت بازگشت

ضمانت بازگشت

فایل های تست شده

فایل های تست شده

پرداخت آنلاین

پرداخت آنلاین

تضمین کیفیت

تضمین کیفیت

دانلود فوری

دانلود فوری

6.1.3 Linux Linux refers to a set of free UNIX distributions such as Cent OS, Debian and Ubuntu. I don't wish to go into details about the benets/drawbacks of each distribution, rather I will concentrate on Debian-based distro. In particular I will be considering Ubuntu Desktop as the algorithmic trading environment. The aptitude package management makes it straightforward to install the necessary under- lying libraries with ease. In addition it is straightforward to create a virtual environment for Python that can isolate your algo trading code from other Python apps. I have never had any (major) trouble installing a Python environment on a modern Ubuntu system and as such I have chosen this as the primary environment from which to conduct my trading. If you would like to give Ubuntu a go before committing fully, by dual-booting for ex- ample, then it is possible to use VirtualBox (https://www.virtualbox.org/) to install it. I have a detailed guide on QuantStart (http://www.quantstart.com/articles/Installing-a-Desktop- Algorithmic-Trading-Research-Environment-using-Ubuntu-Linux-and-Python), which describes the process. 6.2 Installing a Python Environment on Ubuntu Linux In this section we will discuss how to set up a robust, ecient and interactive development environment for algorithmic trading strategy research making use of Ubuntu Desktop Linux and the Python programming language. We will utilise this environment for all subsequent algorithmic trading implementations. To create the research environment we will install the following software tools, all of which are open-source and free to download: ˆ Ubuntu Desktop Linux - The operating system ˆ Python - The core programming environment ˆ NumPy/SciPy - For fast, ecient vectorised array/matrix calculation ˆ IPython - For visual interactive development with Python ˆ matplotlib - For graphical visualisation of data ˆ pandas - For data "wrangling" and time series analysis ˆ scikit-learn - For machine learning and articial intelligence algorithms ˆ IbPy - To carry out trading with the Interactive Brokers API These tools coupled with a suitable MySQL securities master database will allow us to create a rapid interactive strategy research and backtesting environment. Pandas is designed for "data wrangling" and can import and cleanse time series data very eciently. NumPy/SciPy running underneath keeps the system extremely well optimised. IPython/matplotlib (and the qtconsole described below) allow interactive visualisation of results and rapid iteration. scikit-learn allows us to apply machine learning techniques to our strategies to further enhance performance.

چکیده فارسی

 

6.1.3 لینوکس لینوکس به مجموعه ای از توزیع های رایگان یونیکس مانند Cent OS، Debian و Ubuntu اشاره دارد. من نمی‌خواهم به جزئیات در مورد مزایا/معایب هر توزیع بپردازم، بلکه بر توزیع مبتنی بر دبیان تمرکز می‌کنم. به طور خاص من دسکتاپ اوبونتو را به عنوان محیط معاملاتی الگوریتمی در نظر خواهم گرفت. مدیریت بسته aptitude نصب کتابخانه های زیربنایی لازم را به راحتی آسان می کند. علاوه بر این، ایجاد یک محیط مجازی برای پایتون که می تواند کد معاملاتی الگوریتم شما را از سایر برنامه های پایتون جدا کند، ساده است. من هرگز برای نصب یک محیط پایتون روی یک سیستم مدرن اوبونتو مشکل (عمده) نداشتم و به همین دلیل این محیط را به عنوان محیط اصلی برای انجام معاملات خود انتخاب کرده ام. اگر می‌خواهید اوبونتو را قبل از commit کردن کامل، به عنوان مثال با بوت دوگانه، امتحان کنید، می‌توانید از VirtualBox (https://www.virtualbox.org/) برای نصب آن استفاده کنید. من یک راهنمای مفصل در مورد QuantStart (http://www.quantstart.com/articles/Installing-a-Desktop- Algorithmic-Trading-Research-Environment-using-Ubuntu-Linux-and-Python) دارم که این فرآیند را شرح می دهد. 6.2 نصب یک محیط پایتون در لینوکس اوبونتو در این بخش نحوه راه اندازی یک محیط توسعه قوی، کارآمد و تعاملی برای تحقیق استراتژی تجارت الگوریتمی با استفاده از لینوکس دسکتاپ اوبونتو و زبان برنامه نویسی پایتون را مورد بحث قرار خواهیم داد. ما از این محیط برای همه پیاده سازی های معاملاتی الگوریتمی بعدی استفاده خواهیم کرد. برای ایجاد محیط تحقیق، ابزارهای نرم افزاری زیر را نصب می کنیم که همگی منبع باز و رایگان برای دانلود هستند: لینوکس دسکتاپ اوبونتو - سیستم عامل پایتون - محیط برنامه نویسی هسته NumPy/SciPy - برای سریع، و محاسبه آرایه/ماتریس برداری بردار IPython - برای توسعه تعاملی بصری با پایتون matplotlib - برای تجسم گرافیکی داده ها پانداها - برای داده ها "مشاهده" و تجزیه و تحلیل سری های زمانی scikit-learn - برای یادگیری ماشین و الگوریتم های هوش مصنوعی IbPy - برای انجام معاملات با Interactive Brokers API این ابزارها همراه با یک پایگاه داده اصلی اوراق بهادار MySQL به ما اجازه می دهد تا یک محیط تحقیق استراتژی تعاملی و بک تست سریع ایجاد کنیم. پانداها برای "مشاهده داده ها" طراحی شده اند و می توانند داده های سری زمانی را بسیار کارآمد وارد و پاک کنند. NumPy/SciPy در حال اجرا در زیر سیستم را بسیار بهینه نگه می دارد. IPython/matplotlib (و qtconsole شرح داده شده در زیر) امکان تجسم تعاملی نتایج و تکرار سریع را فراهم می کند. scikit-learn به ما این امکان را می دهد که تکنیک های یادگیری ماشین را در استراتژی های خود به کار ببریم تا عملکرد را بیشتر افزایش دهیم.

 

ادامه ...

Author(s): Michael Halls Moore

Year: 2015

 

ادامه ...

Contents I Introducing Algorithmic Trading 1 1 Introduction to the Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.1 Introduction to QuantStart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2 What is this Book? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.3 Who is this Book For? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.4 What are the Prerequisites? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.5 Software/Hardware Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.6 Book Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.7 What the Book does not Cover . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.8 Where to Get Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2 What Is Algorithmic Trading? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.1.1 Advantages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.1.2 Disadvantages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.2 Scientic Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.3 Why Python? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.4 Can Retail Traders Still Compete? . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.4.1 Trading Advantages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.4.2 Risk Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.4.3 Investor Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.4.4 Technology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 II Trading Systems 13 3 Successful Backtesting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.1 Why Backtest Strategies? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.2 Backtesting Biases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 3.2.1 Optimisation Bias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 3.2.2 Look-Ahead Bias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 3.2.3 Survivorship Bias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 3.2.4 Cognitive Bias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 3.3 Exchange Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.3.1 Order Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.3.2 Price Consolidation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3.3.3 Forex Trading and ECNs . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 3.3.4 Shorting Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 3.4 Transaction Costs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 3.4.1 Commission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 3.4.2 Slippage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 3.4.3 Market Impact . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 3.5 Backtesting vs Reality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 4 Automated Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 4.1 Backtesting Platforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 1 2 4.1.1 Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 4.1.2 Research Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 4.1.3 Event-Driven Backtesting . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 4.1.4 Latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 4.1.5 Language Choices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 4.1.6 Integrated Development Environments . . . . . . . . . . . . . . . . . . . . 24 4.2 Colocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 4.2.1 Home Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 4.2.2 VPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 4.2.3 Exchange . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 5 Sourcing Strategy Ideas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 5.1 Identifying Your Own Personal Preferences for Trading . . . . . . . . . . . . . . . 29 5.2 Sourcing Algorithmic Trading Ideas . . . . . . . . . . . . . . . . . . . . . . . . . 30 5.2.1 Textbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 5.2.2 The Internet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 5.2.3 Journal Literature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 5.2.4 Independent Research . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 5.3 Evaluating Trading Strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 5.4 Obtaining Historical Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 III Data Platform Development 39 6 Software Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 6.1 Operating System Choice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 6.1.1 Microsoft Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 6.1.2 Mac OSX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 6.1.3 Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 6.2 Installing a Python Environment on Ubuntu Linux . . . . . . . . . . . . . . . . . 42 6.2.1 Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 6.2.2 NumPy, SciPy and Pandas . . . . . . . . . . . . . . . . . . . . . . . . . . 43 6.2.3 Statsmodels and Scikit-Learn . . . . . . . . . . . . . . . . . . . . . . . . . 44 6.2.4 PyQt, IPython and Matplotlib . . . . . . . . . . . . . . . . . . . . . . . . 44 6.2.5 IbPy and Trader Workstation . . . . . . . . . . . . . . . . . . . . . . . . . 45 7 Financial Data Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 7.1 Securities Master Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 7.2 Financial Datasets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 7.3 Storage Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 7.3.1 Flat-File Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 7.3.2 Document Stores/NoSQL . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 7.3.3 Relational Database Management Systems . . . . . . . . . . . . . . . . . . 49 7.4 Historical Data Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 7.5 Data Accuracy Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 7.6 Automation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 7.7 Data Availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 7.8 MySQL for Securities Masters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 7.8.1 Installing MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 7.8.2 Conguring MySQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 7.8.3 Schema Design for EOD Equities . . . . . . . . . . . . . . . . . . . . . . . 52 7.8.4 Connecting to the Database . . . . . . . . . . . . . . . . . . . . . . . . . . 54 7.8.5 Using an Object-Relational Mapper . . . . . . . . . . . . . . . . . . . . . 54 7.9 Retrieving Data from the Securities Master . . . . . . . . . . . . . . . . . . . . . 59 8 Processing Financial Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 8.1 Market and Instrument Classication . . . . . . . . . . . . . . . . . . . . . . . . . 61 3 8.1.1 Markets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 8.1.2 Instruments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 8.1.3 Fundamental Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 8.1.4 Unstructured Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 8.2 Frequency of Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 8.2.1 Weekly and Monthly Data . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 8.2.2 Daily Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 8.2.3 Intraday Bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 8.2.4 Tick and Order Book Data . . . . . . . . . . . . . . . . . . . . . . . . . . 63 8.3 Sources of Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 8.3.1 Free Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 8.3.2 Commercial Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 8.4 Obtaining Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 8.4.1 Yahoo Finance and Pandas . . . . . . . . . . . . . . . . . . . . . . . . . . 66 8.4.2 Quandl and Pandas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 8.4.3 DTN IQFeed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 8.5 Cleaning Financial Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 8.5.1 Data Quality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 8.5.2 Continuous Futures Contracts . . . . . . . . . . . . . . . . . . . . . . . . . 74 IV Modelling 79 9 Statistical Learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 9.1 What is Statistical Learning? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 9.1.1 Prediction and Inference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 9.1.2 Parametric and Non-Parametric Models . . . . . . . . . . . . . . . . . . . 82 9.1.3 Supervised and Unsupervised Learning . . . . . . . . . . . . . . . . . . . . 83 9.2 Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 9.2.1 Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 9.2.2 Classication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 9.2.3 Time Series Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 10 Time Series Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 10.1 Testing for Mean Reversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 10.1.1 Augmented Dickey-Fuller (ADF) Test . . . . . . . . . . . . . . . . . . . . 88 10.2 Testing for Stationarity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 10.2.1 Hurst Exponent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 10.3 Cointegration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 10.3.1 Cointegrated Augmented Dickey-Fuller Test . . . . . . . . . . . . . . . . . 91 10.4 Why Statistical Testing? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 11 Forecasting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 11.1 Measuring Forecasting Accuracy . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 11.1.1 Hit Rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 11.1.2 Confusion Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 11.2 Factor Choice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98 11.2.1 Lagged Price Factors and Volume . . . . . . . . . . . . . . . . . . . . . . . 98 11.2.2 External Factors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 11.3 Classication Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 11.3.1 Logistic Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 11.3.2 Discriminant Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 11.3.3 Support Vector Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 11.3.4 Decision Trees and Random Forests . . . . . . . . . . . . . . . . . . . . . 101 11.3.5 Principal Components Analysis . . . . . . . . . . . . . . . . . . . . . . . . 101 11.3.6 Which Forecaster? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 4 11.4 Forecasting Stock Index Movement . . . . . . . . . . . . . . . . . . . . . . . . . . 103 11.4.1 Python Implementations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 11.4.2 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 V Performance and Risk Management 107 12 Performance Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 12.1 Trade Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 12.1.1 Summary Statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 12.2 Strategy and Portfolio Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 12.2.1 Returns Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 12.2.2 Risk/Reward Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 12.2.3 Drawdown Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 13 Risk and Money Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 13.1 Sources of Risk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 13.1.1 Strategy Risk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 13.1.2 Portfolio Risk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 13.1.3 Counterparty Risk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 13.1.4 Operational Risk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 13.2 Money Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 13.2.1 Kelly Criterion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 13.3 Risk Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 13.3.1 Value-at-Risk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 13.4 Advantages and Disadvantages . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 VI Automated Trading 127 14 Event-Driven Trading Engine Implementation . . . . . . . . . . . . . . . . . . 129 14.1 Event-Driven Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 14.1.1 Why An Event-Driven Backtester? . . . . . . . . . . . . . . . . . . . . . . 130 14.2 Component Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 14.2.1 Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131 14.2.2 Data Handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 14.2.3 Strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 14.2.4 Portfolio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142 14.2.5 Execution Handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 14.2.6 Backtest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152 14.3 Event-Driven Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155 15 Trading Strategy Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . 163 15.1 Moving Average Crossover Strategy . . . . . . . . . . . . . . . . . . . . . . . . . . 163 15.2 S&P500 Forecasting Trade . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168 15.3 Mean-Reverting Equity Pairs Trade . . . . . . . . . . . . . . . . . . . . . . . . . 172 15.4 Plotting Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179 16 Strategy Optimisation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 16.1 Parameter Optimisation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 16.1.1 Which Parameters to Optimise? . . . . . . . . . . . . . . . . . . . . . . . 181 16.1.2 Optimisation is Expensive . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 16.1.3 Overtting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 16.2 Model Selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 16.2.1 Cross Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183 16.2.2 Grid Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 16.3 Optimising Strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 5 16.3.1 Intraday Mean Reverting Pairs . . . . . . . . . . . . . . . . . . . . . . . . 191 16.3.2 Parameter Adjustment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191 16.3.3 Visualisation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

ادامه ...
برای ارسال نظر لطفا وارد شوید یا ثبت نام کنید
ادامه ...
پشتیبانی محصول

۱- در صورت داشتن هرگونه مشکلی در پرداخت، لطفا با پشتیبانی تلگرام در ارتباط باشید.

۲- برای خرید محصولات لطفا به شماره محصول و عنوان دقت کنید.

۳- شما می توانید فایلها را روی نرم افزارهای مختلف اجرا کنید(هیچگونه کد یا قفلی روی فایلها وجود ندارد).

۴- بعد از خرید، محصول مورد نظر از صفحه محصول قابل دانلود خواهد بود همچنین به ایمیل شما ارسال می شود.

۵- در صورت وجود هر مشکلی در فرایند خرید با تماس بگیرید.