Young.Andrew-Expert.Advisor.Programming-Creating.Automated.Trading.Systems.in.MQL.for.Metatrader.4.(2010) [CC093622].pdf

(1295 KB) Pobierz
1216164858.001.png
Expert Advisor
Programming
Creating Automated Trading Systems
in MQL for MetaTrader 4
Andrew R. Young
Edgehill Publishing
SECOND PRINTING
Copyright © 2010, Andrew R. Young. All rights reserved.
Published by Edgehill Publishing, Nashville, TN.
Disclaimer of Warranty: While we have strived to ensure that the material in this book is accurate, the
publisher bears no responsibility for the accuracy or completeness of this book, and specifically
disclaims all implied warranties of of merchantability or fitness for a particular purpose. Neither the
author nor publisher shall be liable for any loss of profit or any other non-commercial or commercial
damages, including but not limited to consequential, incidental, special, or other damages.
"MetaTrader 4," "MQL" and "expert advisor" are trademarks of MetaQuotes Software Corp.
This book and it's publisher is not in any way endorsed by or affiliated with MetaQuotes Software
Corp.
For more information on this book, including updates, news and new editions, please visit our web
site at http://www.expertadvisorbook.com/.
ISBN: 978-0-9826459-0-1
Table of Contents
Introduction
1
About This Book
2
A Note About MQL 5
2
Conventions Used In This Book
3
An Introduction to MQL
4
Introduction to MetaEditor
4
Basic Concepts
7
Layout of an MQ4 File
14
Order Placement
20
Bid, Ask & Spread
20
Order Types
20
The Order Placement Process
21
OrderSend()
22
Calculating Stop Loss & Take Profit
25
Retrieving Order Information
32
Closing Orders
34
A Simple Expert Advisor
36
Advanced Order Placement
42
Order Modification
42
Verifying Stops and Pending Order Prices
45
Calculating Lot Size
49
Other Considerations
52
Putting It All Together
57
Working with Functions
64
Add Stop Loss and Take Profit
73
Using Include Files
74
Using Libraries
74
A Simple Expert Advisor (with Functions)
75
1216164858.002.png
 
Zgłoś jeśli naruszono regulamin