Contents
Cover
Series
Title Page
Copyright
Dedication
Epigraph
Foreword
Preface
Acknowledgments
Author’s Note
Chapter 1: Introduction to EasyLanguage
INTRODUCTION
WHAT THIS BOOK IS NOT
WHAT THIS BOOK IS
A CHART IS A CHART IS A CHART
FONTS, SYMBOLS, AND CONVENTIONS
Chapter 2: Quick Start
INTRODUCTION
PSEUDO-STEPS
DETAILED STEPS
CONCLUSION
Chapter 3: Understanding the Process
REVIEW
STEP 1: OBSERVATION
STEP 3: PROGRAMMING AND QUALITY ASSURANCE
STEP 4: MARKETING AND SALES
SUMMARY
Chapter 4: Basic Use of TradeStation
INTRODUCTION
BASIC ELEMENTS OF TRADESTATION
OLDER VERSIONS OF TRADESTATION: READ THIS SECTION
ALL VERSIONS COME HERE
QUICK START TO TAILORING YOUR CHART AND STRATEGY
Chapter 5: Basic Math
INTRODUCTION
ADDING AND SUBTRACTING
MULTIPLYING AND DIVIDING
DECIMALS AND FRACTIONS
ABSOLUTE VALUE
PERCENTAGES
RATIOS AND PROPORTIONS
EXPONENTIATION (POWERS) AND LOGARITHMS
LINEAR AND SEMI-LOG SCALING
RELATIONAL OPERATORS
AVERAGES
ANSWERS
Chapter 6: Basic EasyLanguage
INTRODUCTION
SKELETONS (TEMPLATES)
WRITING YOUR OWN
CHARTING YOUR INDICATOR
SUMMARY
Chapter 7: Programming Conventions
INTRODUCTION
ORDER DEPENDENCIES AND THE LIBERAL USE OF PARENTHESES
TAKE IT SLOWLY—ONE STEP AT A TIME
PUNCTUATION
SKIP WORDS
ALL ABOUT BARS
CURRENTBAR
MAXBARSBACK
INPUTS AND VARIABLES
VARIABLES
STATEMENTS
COMMAND STRUCTURE
PROGRAM STRUCTURE
FLOW
COMMENTS
VERIFYING YOUR CODE
ERROR HANDLING
DEBUGGING TRICKS
BREAKPOINT
Chapter 8: Statements
INTRODUCTION
DECLARATION STATEMENTS
VARIABLES
INPUTS
ASSIGNMENT STATEMENTS
DATA MANIPULATION
PRINT STATEMENTS
FORMATTING IN THE PRINT STATEMENT
DECIMAL PLACES
LABELS FOR READABILITY
IF…THEN STATEMENTS
PLOT STATEMENTS
Chapter 9: Ifs, Ands, and Buts
INTRODUCTION
SYMBOLIC LOGIC
TRUTH TABLES
DECISIONS (CONDITIONS)
REAL-LIFE EXAMPLE
MORE ABOUT IF AND IF … THEN … ELSE
Chapter 10: Begin and End (Block Statements)
INTRODUCTION
BLOCK STATEMENTS
NESTED BLOCK STATEMENTS
WORKING ON OUR STRATEGY
Chapter 11: Loops
INTRODUCTION
FOR
WHILE
Chapter 12: Analysis Techniques
INTRODUCTION
USING STRATEGIES
WRITING YOUR OWN SYSTEMS, STRATEGIES, AND SIGNALS
ALTERING TRADESTATION’S STRATEGIES
EVALUATING STRATEGIES
BUILT-IN INDICATORS
WRITING INDICATORS
SHOWME
PAINTBARS
FUNCTIONS
Chapter 13: Buying and Selling
INTRODUCTION
ENTRIES
ORDER NAMES
EXITS
Chapter 14: Functions
WHAT IS A FUNCTION?
STRUCTURE OF A FUNCTION
TEMPLATE FOR A FUNCTION
EXAMPLES OF FUNCTIONS
Chapter 15: Tricky Math
INTRODUCTION
SIGN OF A NUMBER
ROUNDING, TRUNCATING, AND INTEGER ARITHMETIC
MINIMA AND MAXIMA
Chapter 16: TradeStation Tricks
INTRODUCTION
TRICKS WITHIN TRADESTATION
TIPS AND TRICKS FROM BILL BROWER
EIGHT BALL FROM THE TRADESTATION USERS’ FORUM
TIPS AND TRICKS FROM LARRY WILLIAMS
TIPS AND TRICKS FROM TRADESTATION STAD
TIPS AND TRICKS FROM SAMUEL K. TENNIS
TIPS AND TRICKS FROM EASYLANGUAGE HOME STUDY COURSE
TIPS AND TRICKS FROM GLEN LARSON (OF GENESIS FINANCIAL TECHNOLOGIES)
TIPS AND TRICKS FROM ARTHUR G. PUTT
TIPS AND TRICKS FROM THE TRADESTATION NEWSLETTER
FILEAPPEND
SUMMARY
Chapter 17: Optimization
INTRODUCTION
WHAT IS OPTIMIZATION?
HOW MUCH IS ENOUGH?
WHEN TO OPTIMIZE
RUN THE OPTIMIZATION
CHANGING THE OPTIMIZATION CRITERIA
WORKING WITH THE OPTIMIZATION REPORT
CURIOUSER AND CURIOUSER
CONCLUSION
Chapter 18: System Performance
INTRODUCTION
PERFORMANCE SUMMARY
TRADE-BY-TRADE REPORTS
SUNNY’S IMPORTANT NUMBERS
SHARPE RATIO
Chapter 19: Conclusion
SUMMARY: PUTTING IT ALL TOGETHER
LAST WORDS
Appendix A: Styles
LINE STYLE
COLORS
Appendix B: Reserved Words
RESERVED WORD AND MEANING
A
B
C
D
E
F
G
H
I
J
L
M
N
O
P
Q
R
S
T
U
V
W
Y
Appendix C: Formulas
ASYMMETRICAL LEVERAGE
CPC™ (CARDINAL PROFITABILITY CONSTRUCTS)
EXPONENTIAL MOVING AVERAGE
HERICKPAYOFF INDEX
MARKET FACILITATION INDEX
MATHEMATICAL EXPECTATION (ME)
MOVING AVERAGE (MAV)
MARKET FACILITATION INDEX
OPTIMAL-F
PERCENT PROFITABILITY
PESSIMISTIC RETURN RATIO (PRR)
PHW™ (POTENTIAL HOURLY WAGE)
PROFIT FACTOR
RATIO OF THE AVERAGE PROFITABLE TRADE TO THE AVERAGE LOSING TRADE (P/L RATIO)
WILDER’S RSI
RUNS
STOCHASTICS
Appendix D: Full Code for the Systems and Studies in This Book
SIGNAL TO CLOSE THE OPEN TRADE
INDICATOR FOR 200-DAY MOVING AVERAGE
PAINTBAR FOR 200-DAY MOVING AVERAGE
SHOWME FOR 200-DAY MOVING AVERAGE
FILTER FOR 200-DAY MOVING AVERAGE
OUR STRATEGY
Appendix E: Baskets
Appendix F: Where’s the Command?
Appendix G.1: Built-in Functions and Indicators (Alphabetical Listing)
Appendix G.2: Built-in Functions and Indicators (Functional Listing)
FUNCTIONS AND INDICATORS
Appendix H: TradeStation Add-on Products and Services
TRADER’S CATALOG & RESOURCE GUIDE™: THE FINANCIAL YELLOW PAGES
Appendix I: TradeStation User Groups
Appendix J: Error Messages
Appendix K: What’s Wrong with This Code?
Bibliography
Index
Founded in 1807, John Wiley & Sons is the oldest independent publishing company in the United States. With offices in North America, Europe, Australia and Asia, Wiley is globally committed to developing and marketing print and electronic products and services for our customers’ professional and personal knowledge and understanding.
The Wiley Trading series features books by traders who have survived the market’s ever changing temperament and have prospered—some by reinventing systems, others by getting back to basics. Whether a novice trader, professional or somewhere in-between, these books will provide the advice and strategies needed to prosper today and well into the future.
For a list of available titles, visit our Web site at www.WileyFinance.com.
Copyright © 2011 by Sunny J. Harris. All rights reserved.
Published by John Wiley & Sons, Inc., Hoboken, New Jersey.
Published simultaneously in Canada.
No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise, except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600, or on the Web at www.copyright.com. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions.
Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their best efforts in preparing this book, they make no representations or warranties with respect to the accuracy or completeness of the contents of this book and specifically disclaim any implied warranties of merchantability or fitness for a particular purpose. No warranty may be created or extended by sales representatives or written sales materials. The advice and strategies contained herein may not be suitable for your situation. You should consult with a professional where appropriate. Neither the publisher nor author shall be liable for any loss of profit or any other commercial damages, including but not limited to special, incidental, consequential, or other damages.
TradeStation, OptionStation and SuperCharts are registered trademarks of TradeStation, Inc. TradeStation ProSuite, ActivityBars, EasyLanguage, GlobalServer, HISTORYBANK Financial Database, PaintBar, Portfolio Maximizer, PowerEditor, ProbabilityMaps, RadarScreen, ShowMe, SmartAsk, SmartBid, SmartStyling and SystemBuilder are trademarks of TradeStation, Inc. HISTORYBANK.COM and OmegaWorld are service marks of TradeStation, Inc. Other names and marks referred to are the property of their respective owners.
In recognition of TradeStation’s trademarks and copyrights, uses in the book of TradeStation, EasyLanguage, OptionStation, Historybank.com, GlobalServer or Super Charts imply TradeStation TradeStation, TradeStation EasyLanguage, TradeStation OptionStation, TradeStation Historybank.com, TradeStation Super Charts and TradeStation GlobalServer respectively.
For general information on our other products and services or for technical support, please contact our Customer Care Department within the United States at (800) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic books. For more information about Wiley products, visit our web site at www.wiley.com.
ISBN 978-0-471-35353-9; ISBN 978-1-118-06315-6 (ebk);
ISBN 978-1-118-06316-3 (ebk); ISBN 978-1-118-06317-0 (ebk)
I’ve been working on this book since 1996; that’s 12 years now. Wow! When I first began, my daughter was pregnant with my second grandson, whose name is Sterling Kodiak Yates, now 10. This book is dedicated to Sterling and to my back-ordered grandchildren (hopefully from my son’s new wife, Laurel).
The human mind, once stretched to include a single new idea, does not shrink back to its original proportions.
–Oliver Wendell Holmes
Until one is committed, there is hesitancy.
–W. H. Murray
We must never assume that which is incapable of proof.
–G. H. Lewes
Be sure of it; give me the ocular proof.
–Shakespeare
Foreword
One of the early users of TradeStation software, Sunny Harris has been studying and programming trading strategies for more than 30 years.
I have watched her progress as a researcher and trader over the years, from the time we were still offering the DOS version of SystemWriter and TradeStation was a fledgling company.
Sunny is one of the most studious and diligent people I know and gives generously in teaching others what she has learned through the school of hard knocks. Having a software background herself, and writing books that focus on helping beginners (Trading 101—How to Trade Like a Pro, Trading 102—Getting Down to Business, Electronic Day Trading 101, and Getting Started in Trading) have inevitably led to the writing of this book.
Successful traders have one thing in common: they approach trading by developing an objective strategy and then use it consistently.
TradeStation allows traders to design their own trading strategies, back-test them on years of historical data, and then computer-automate them. The power of EasyLanguage is what makes all of this possible. Therefore, by mastering EasyLanguage, you have the power to test any idea you can imagine.
Through the many examples, Sunny Harris walks you through in this book, you’ll have a much better understanding of how to use EasyLanguage to create your own strategies. This book also provides you with an invaluable guide for trading strategy development that will contribute greatly to the understanding and improvement of your EasyLanguage skills.
Sunny’s unique ability to blend her highly theoretical math degrees with her artistic and graphics talents makes her understanding of markets both logical and intuitive. She has been a friend of TradeStation for many years, always lending insight and advice, and as one of our beta testers she has helped create the best possible market analysis software there is today: TradeStation.
Analyzing the markets can be daunting—a task taken on by many but mastered by few. As an aid to all analysts, our software has to be ready manage incredibly difficult tasks and the most pedantic at the same time. Sunny’s 20-plus years of self-taught market analysis combined with her 10 years of experience teaching others to trade has led her to write the most readable and invaluable of books about EasyLanguage.
Through the many examples in this book, you’ll have a much better understanding of how to use EasyLanguage to create your own strategies. This book also provides you with an invaluable guide for trading strategy development that will contribute greatly to the understanding and improvement of your EasyLanguage skills.
The time you invest in mastering EasyLanguage will be the best investment of your trading life.
If you are a TradeStation or ProSuite user, this book is a must. If you are serious about learning to trade, read Sunny’s books—the truth lies within.
I wish you a very successful trading career.
Bill Cruz
Founder and former CEO of TradeStation
Preface
This book is one of a kind. It is perhaps the only book written by a self-taught Easy-Language speaker (programmer) who learned and helped improve EasyLanguage before there was even a TradeStation, and who is an actual trader.
I was trading beginning in 1981, when just about the only good graphics analysis package was called MasterChartist, by Roberts-Slade. The problem was, there was no testing language with which to evaluate and back-test your trading ideas. Back then we were running DOS only; or, there was no Windows yet. Testing your strategies amounted to using a rudimentary version of Excel and pencil and paper. It was tedious at best.
Along came a program by Omega Research, called SystemWriter Plus. It was a god send! At last I could rough out my ideas and test them against mounds of historical data. However, as with everything, there was a serious drawback. It only worked on daily data, not on intraday data. I was able to receive intraday data on MasterChartist but not to test it. I could draw (with a pencil) on the charts but not strategize buy and sell opportunities. With SystemWriter Plus I could print out mounds of data analysis, but the charts were rudimentary, coming out of a dot matrix printer, and only on daily data. What to do?
As necessity is the mother of invention, I decided to divide my real-time data from MasterChartist into 15-minute increments and treat it as if it were daily data over a very long period of time. I imported the fake daily data into SystemWriter. It took me 18 months to massage the data and convert it into years and years worth of 15-minute increments. (There was no CompuTrac yet either.) In order to make sense of a chart, it is necessary to demarcate dates and times along the x-axis. This took some ingenuity, and some “gerfingerpointing.” I created a ruler with tiny marks along each day to designate 15-minute increments and ignored the Monday, Tuesday, Wednesday markings on the chart itself. To find a time during any particular day, I had to measure and mark divisions with my specially marked ruler.
It worked. I was able to test intraday trading concepts and determine success or failure statistically, even without software that operated on an intraday basis. Finally, Microsoft invented Windows, and the software vendors followed suit with more and more sophisticated programs, soon allowing not only 15-minute increment data but any minute divisions and even tick-by-tick charts.
The most important component of this new and powerful tool was in running walk-back and walk-forward tests. Did my theory of making profits hold up last week, last month, and last year? It quickly became obvious that I could spot a theory that would work for the past three Fridays; but when I tried it in real time, I lost money for the next three Fridays. Why did that happen?
For several years I plugged away with spreadsheet, pencil, and lots of erasers at hand, keeping copious notes of the ideas that I tried against market data to see if there was any hope of creating a mechanical system that worked.
What did “worked” mean? That in itself is a whole ’nother problem. I realized I had two large problems: finding a system that worked and finding a set of statistics that measured success. It took me the better part of three years devoting 18 hours a day to the task to come up with a meaningful system and statistics that measured its success.
In this book I share with the reader not only what I learned through three solid and dedicated years of 18-hour research days, but what I have learned subsequently through real-time trading. I wish you the best in your efforts. But I would admonish you to read this book over and again and to spend the time doing your own research following the pattern set out herein.
And now it’s 2010---and according to author Thomas Friedman, the world is flat. We are living in a flat world devoid of boundaries of language, communications, or even time constraints. We can talk with anyone, anytime, anywhere with the help of email, Skype, GoogleTalk, and tiny onboard cameras. Our computers and software are purchased over the Internet, constructed of tiny parts made in China and Taiwan, and our customer support folks are in India. When the market crashed in September 2008, it was China that bought 49% of our debt from many of our banks. No more walls. Even our cell phones are now computers that link us with the whole world: I can take your picture and send it with text to anyone, anywhere. I can make a PowerPoint presentation, put it in pdf format, and make my product demonstration to you from my cell phone or my PDA. It’s endless and magnificent.
Without EasyLanguage, where would we all be? Someone had to do it. And, as luck, good fortune, and the wisdom to see and act on the opportunity would have it, the Cruz brothers and their sister (Ralph, Bill and Michelle) were the team to pick up the gauntlet and run with it. And now we trade 24-hour markets, all over the world, in a flash, with the push of a button on a TradeStation screen. The data is next to free, the software is included in the price of your having an account at TradeStation Securities, and the commissions are ridiculously low.
It’s a M-U-R-I-C-A-L. (Miracle.)
TradeStation almost doesn’t need a manual. It is so easy to use and so intuitive that it almost seems silly to write this book. But there is more to it than just a users’ manual. Besides getting the software up and running on your computer, you need the benefit of my years and years of experience making every mistake “in the book.” There is no need for you to repeat my errors, nor for you to hunt and peck your way to success. In this book I hope to lead you through the process of installing the program, using it for the first time or two, and writing your first several indicators and strategies. If you tried it on your own, from the TradeStation Users’ Manual, you would probably give up before you even got to the point of trading. By design, all users’ manuals are full of technical descriptions of all the program’s bells and whistles from A to Z. In that order. There’s no rhyme or reason to what the user needs to do first, second, and third: it’s just an alphabetical reference to everything in the program.
Instead of a reference manual, however, with this tome I am writing a cookbook. Step 1, do this; step 2, do that. It is a simplistic approach, but one that will get you on the road to doing it yourself much quicker and with much more confidence. Then you can go back to the reference materials with some understanding of what to look for.
One more thing before I get on with it. I have been using TradeStation since before it was called TradeStation. I have seen the versions go from 1, to 2, all the way to 8.8 and now 9.0, which is the version I am currently using. In many ways all the versions are alike, and in many ways they differ vastly. When I first started writing this book, I thought I would give instructions for the most recent three versions of TS and compare and contrast the differences. As the years went on and the book progressed, the versions kept coming and coming and coming---faster than I could write. And that is still true. As I am putting the finishing touches on the manuscript, yet another version of TS has been released, which differs in many respects from the prior version. Never fear! This book applies to them all.
One of the biggest differences between TradeStation 2000i and TradeStation 4.0 is in the way they engage systems. TradeStation 2000i made enhancements for testing a variety of entries and exits without getting back into EasyLanguage and modifying your code. This can be a great advantage, unless you are entrenched in the methods of 4.0 and are reluctant to change. On first inspection, it would seem that TradeStation has added two steps to every attempt to employ a system, and initially that is irritating. But once you realize the tremendous advantages to mixing and matching entry and exit signals, you’ll get used to it and be thankful.
After version 2000i, the company again integrated EasyLanguage with the main program. With versions 8.8 and 9.0 it has once again separated the EasyLanguage Editor from the main program and made it stand-alone. In spite of all these changes, this book will apply universally to all versions before and hereafter. Don’t worry if you are reading this book years after it was first released. The concepts are applicable to whatever version of TradeStation you are using.
With version 9.0 TradeStation’s EasyLanguage is a complete programming language, much like VB or C++. It has tremendous strides in extensibility for programmers. We are not going to address any of that in this easy book. that will be left for the advanced book.
Acknowledgments
Thanks to Pamela van Giessen for originally telling me I could write, and encouraging me to write my first book, Trading 101—How to Trade Like a Pro. I really thought that I had nothing to say.
And thanks to Bill Cruz, co-founder of TradeStation, who helped me along the way with learning EasyLanguage.
Because of all he has contributed to this industry, and to my personal learning, a great big thanks goes out to Larry Williams, who really trades for a living.
My 88-year-old, nearly blind, mother proofread this manuscript with her magnifying glass, all 733 pages of it. I’m eternally grateful for her help and her inspiration. My children and grandchildren have been patient and understanding as I sat behind my laptop while they watched TV and movies, played games, and built Lego monuments. I’ve been halfway participating for years during the growth of this tome. I thank them for their creativity and their love.
And most of all, I thank my partner of 21 years for her continued support and understanding and encouragement during thick and thin. She’s an exceptional partner and a magnificent physician.
To those who are reading this book, I thank you also. You will grow by immeasurable bounds as you read and learn. Keep up the good work. And tell your friends.
Author’s Note
Please understand that this book is intended to be educational in nature. I am not recommending that you trade, nor am I giving trading advice. Further, I am not suggesting that any of the methods presented in this book will generate a profit or will not generate losses.
Sunny J. Harris, Sunny Harris & Associates, Inc. and Sunny Harris Enterprises, Inc. accept no liability whatsoever for any loss arising from any use of this information.
This information is in no way a representation to buy or sell securities, bonds, options, or futures. Always check with your licensed financial planner or broker before buying or selling on any advice whether contained herein or elsewhere.
It should not be assumed that the methods, techniques, or indicators presented in this book will be profitable or that they will not result in losses. Past results are not necessarily indicative of future results. Examples in this book are for educational purposes only. This is not a solicitation of any offer to buy or sell.
Trading and investing are speculative and include risk of loss. Past performance is no indication of future results.
Hypothetical or simulated performance results have certain inherent limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades may not have been executed, the results may have under- or overcompensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profits or losses similar to those shown.
Any statements of facts herein contained are derived from sources believed to be reliable but are not guaranteed as to accuracy, nor do they purport to be complete. No responsibility is assumed with respect to any such statement, nor with respect to any expression of opinion herein contained. All trade recommendations should be discussed with your broker and made at your own risk.
Chapter 1
Introduction to EasyLanguage
INTRODUCTION
EasyLanguage is TradeStation’s proprietary command language that lets you specify your trading ideas in plain English and test them before you trade. EasyLanguage allows you to write your own trading systems for TradeStation, OptionStation, and ProSuite without having to know complicated computer programming languages.
EasyLanguage is one of the most powerful and useful features of TradeStation and with some practice, you can become an expert, even if your background in computers is limited.
That said (it’s from the splash screen introduction to TradeStation software), all software comes with stumbling blocks. I have yet to open a software box and install and use the product with no problems along the way. Furthermore, TradeStation’s EasyLanguage is more than just software; it’s a programming language. And with the advent of the new Object-Oriented EasyLanguage with TradeStation version 9.0, it is more like C++ than any easy language. Albeit the easiest to use of the complex trading tools, it is still so full of features that it can’t help but be difficult in spots. As I work with EasyLanguage I hum the old song by The Essex from 1963: ``Easier Said Than Done.’’
The working title for the ideas presented in this book was “EasyLanguage Ain’t.” Neither Bill Cruz, prior co-CEO of TradeStation, nor my editor, Pamela van Giessen, liked that title. Nevertheless, the viewing public seemed to appreciate the reality of the working title. Each time I mentioned the project in a lecture I got nods of recognition from non-programming TradeStation, SuperCharts, and OptionStation users.
“EasyLanguage Ain’t” was never meant to be disparaging to TradeStation, but rather a reflection of the simple truth that programming a computer, no matter how friendly the programming language, is never easy. Becoming a good coder takes study, sometimes years of study. It is the intent of this book to walk the reader through that learning process in small and simple steps that will make the process comfortable. I have recently noticed the tendency of some of my competitors to use the paraphrase “EasyLanguage Isn’t,” and I herewith forgive them their lack of imagination.
Computer manuals aren’t meant to be read cover to cover. The TradeStation Users’ Manual is no exception. TradeStation Made Easy! however, is intended to be read from cover to cover, with pauses along the way to try the examples. Hopefully it will be an informative and enjoyable experience for you. After reading this book, you will be more prepared to go back and use the TradeStation manuals with ease and as reference.
In Trading 101—How to Trade Like a Pro, I wanted to introduce the basic concepts of trading to the general public. In Trading 102—Getting Down to Business my hope was to introduce the concepts of system design and testing. TradeStation Made Easy! is intended as a procedural guide to getting comfortable with programming Trade-Station’s EasyLanguage.
At the same time I am writing this book I am also researching one more: Grading the Gurus. You will probably be interested in Gurus as well, since it is all about using TradeStation (and other popular software) to test the theories, strategies and technical analysis of some of the famous systems designers. The intent of the Gurus book is to discover both the advantages and downfalls of following other people’s systems. After that I want to write a book exploring all the commonly available systems and strategies from nongurus, strategies you find published in books, their benefits and pitfalls, and maybe call it “Breaking the Rules.”
We, the trading public, owe a debt of gratitude to Bill and Ralph Cruz and their crew, whose dedication to an initially narrow market has expanded that market and created tools we can all use to profitable ends. Thanks, guys; you have a great product.
During late January of 1999 I took a little trip to the Bahamas and then to Miami, where I had the pleasure of spending several days with TradeStation personnel. The purpose of my visit was to get an advance look at the impending, latest release of TradeStation, called 2000i, as part of the research for this book. For their generosity, hospitality, and help I would like to thank Loren Costantino, Gaston Sanchez, Kevin Feuerlicht, Amy Solt, Janette Perez, Bill and Ralph Cruz and the rest of the TradeStation staff. You’re the greatest!
WHAT THIS BOOK IS NOT
TradeStation Made Easy is not meant as a replacement for the TradeStation manuals. This programming guide is not meant to help you learn the mechanics of setting up Trade-Station or your computer, or to help you with the trials and tribulations of getting data into your computer.
This book is also not meant to teach you systems, or to give you systems that are necessarily profitable, though we may discover some along the way. We will cover the essence of programming in EasyLanguage and stick with a consistent set of data and a consistent elementary system throughout. We will not fill the book with a variety of working systems with which you can experiment; there are other books for that.
In particular, if you are looking for fancy EasyLanguage programming ideas I would suggest these sources:
- Cynthia Kase
Kase and Company, Inc.
PO Box 226 Cheyenne, WY 82003
(505) 237-1600
www.kaseco.com
- Joe Krutsinger
PO Box 4223
Kansas City, KS 66104
(800) 927-1035
www.joekrut.com
- Using Easy Language by Arthur G. Putt
available from Ruggiero Press
- Murray Ruggiero
Ruggiero Press
18 Oregon Ave., East Haven, CT 06512
1-203-564-1956
- TS Express by Bill Brower
Inside Edge Systems, Inc.
10 Fresenius Rd., Westport, CT 06880
1-203-454-2754
- Ask Mr. EasyLanguage by Sam Tennis
129 Staff Drive, NE
Fort Walton Beach, FL 32548
1-850-243-5105
http://www.vista-research.com
WHAT THIS BOOK IS
This book is a guide to understanding the basics and beginning to use EasyLanguage. I offer this service because it fills a gap—no one else has dedicated their writings to the beginners. The more advanced tasks to becoming a TradeStation expert are between you and TradeStation, and perhaps a consultant to help you along the way. Bill Brower is an excellent resource for advanced techniques, but his efforts at teaching beginners are still too advanced for most novices.
By the end of this book you will be able to write simple and intermediate programs using EasyLanguage. Hopefully your programs will accurately reflect the theories you have, discover, or read about the markets.
By the end of this book you will have the confidence to open TradeStation’s PowerEditor to a blank page and begin writing.
As I began this book, I put in examples for all the existing versions of TradeStation at that time. Now, many years later, I’m pruning it all down to the current version only. All references to ProSuite, 2000i, and earlier versions of TradeStation are being removed. If you need help with a previous version of TradeStation, give me a call and we’ll talk about it.
A CHART IS A CHART IS A CHART
This book is not about learning to trade; it is about learning to program.
Nevertheless, throughout the book we will be reviewing and using trading concepts as examples while learning to program. In learning programming concepts, it really does not matter what our underlying data is. What we will cover in this book is how to express your theories and ideas about whatever market interests you, independent of any particular market.
A chart, is a chart, is a chart. They all go up, or down, or sideways, or all three. If you were not told what instrument (stock, bond, mutual fund, commodity) was used to produce the chart in Figure 1.1, you would not be able to guess it. No, it is not the Dow. I have not given you a reference axis for time frame (X-axis), nor is there a reference axis for price (Y-axis). In spite of that absence of information, you could tell me some things about the chart. You could tell me that the second half of the chart is less volatile than the first half. You could tell me that in the beginning, price moves downward. You could tell me that after the beginning downward move, there is a period of nearly upward movement followed by downward movement. You could not tell me that in general the bias is to the upside. You could also tell me there is a mild correction (downward movement) in the last third of the chart.
(In fact, I will give a crisp new $20 bill to the first person who calls me and correctly identifies the chart in Figure 1.1.)
This sort of analysis is what I call “What is?” or “What is true?” I begin every investigation by repeatedly asking myself ``What is true of the chart at which I am looking?’’ It’s the “what is” that leads to rich brainstorming sessions and possibilities for analysis.
What you could not tell me is whether this is a chart of a commodity, stock, or mutual fund. You could not tell me if it is a chart of 1-minute, 5-minute, 60-minute, or daily data. And you could not tell me whether this price action happened in 1927, 1987, or 2010.
In fact, this is an example of what they mean when they say the markets are fractal. Each subset, or smaller time frame, looks like any other time frame. They all go up, they all go down, and they all go sideways. It’s just another way of saying “a chart is a chart is a chart.”
For the purpose of this book, the particulars of the chart do not matter; what matters is that the chart has movement and that we can describe it in programming language.
The best way I know to make this book easy to use and comprehend is to build on a simple concept from beginning to end. To this end, I will introduce a single set of data that we will use throughout. That data is available for you on my Web site: www.moneymentor.com/TSME.html. If you’d like to receive a CD of the data, just contact my office in California at 1-760-444-4174 Skype or my cell at 1-760-908-3070. I ask only that you observe Pacific Standard Time.
We will use the same chart and the same data throughout this book. We will take different perspectives, sometimes viewing daily data, sometimes weekly, sometimes intraday, but it will all be of the same vehicle. I have always wondered why authors choose a different chart to illustrate every new concept. I’ve wondered whether the concepts are only applicable to certain subsets of charts. As I tackle this book, I guess I am about to find out.
I will also start early in this book with a simple program to analyze the data and build on that program as we progress. That way you will be learning about the structure of EasyLanguage, not struggling with a new program every few pages. You will become intimately familiar with one set of data and one small program. We will analyze this single set of data at increasing depth, and will alter and enhance our initial program until it becomes sophisticated.
After you finish this book you can easily branch off and apply your new language to very complex concepts. You will be able to understand many of the sophisticated techniques presented in Omega magazine, TradeStation’s manuals, Technical Analysis of Stocks & Commodities magazine, Futures magazine, Traders’ Catalog & Resource Guide, and the various other sources and books mentioned herein.
FONTS, SYMBOLS, AND CONVENTIONS
I’ve used a few symbols in the book and some typefaces to separate code from text. All programming code herein is designated by using the typeface OCRA. All computer commands are shown in the typeface Helvetica. An arrow (→) means to pull down the menu and choose the next command. A mouse symbol () means to use the mouse to pull down or click to the command. Everything else is pretty much self-explanatory.