翻译与研读 Building Winning Trading System with TradeStation

Discussion in 'Philosophy and Strategy' started by 思迷思, Jul 15, 2005.

  1. The book was designed with the trader in mind. Most of the trading techniques were designed and tested with indices,futures,and commodities(we focused on these markets due to their long histories with trading system). Strictly equity traders will still get a good programming and system design education. Index(mimi or full-size) and futures traders will be privy to five highly successful trading approaches. These approaches are good launch-pad for further and much more detailed research.
     
  2. In our opinion, the best way to make full use of this book is for the reader to work his way through the book starting with Chapter 1. At the end of chapters that have detailed analysis techniques (or computer programs—the two terms are interchangeable), We would suggest loading from the CD-ROM, verifying, and running the programs in TradeStation. The concepts of each chapter should be mastered before moving on to the next chapter.
    We hope you (the reader) enjoy this book and that it open your eyes to the power of TradeStation and your own creativity. Good luck and good trading.
     
  3. 由于此书相当大的部分涉及到计算机代码,随书附赠一盘载了所有代码与数据的光盘。分析技术是以TradeStation 2000i 和 TradeStation 6.0的格式提供。只需将代码与数据简单地输入相应版本的PowerEditor,早期版本的用户也能应用这些分析技术。第五章借用Microsoft Excel扩展页软件功能的帮助实现三维轮廓图表。Excel不是必须的,在数据向图形的转换中只需要扩展页软件的几项功能。
     
  4. 此书按照交易人员的实际需求进行编写。绝大多数交易技术的设计与测试都是以指数,期货和商品为对象进行的(由于使用交易系统的长久历史我们特别地关注这些市场)。确切地讲,平衡交易员仍可得到编程与系统设计的好的培训。指数(小的或全市场)和期货交易者将获得5 个相当成功的作者个人开发的交易方法。对于更进一步与详细的研究,这些方法提供了一个导引。
     
  5. 我们建议最好从第一开始循序渐进地研读此书。提供了详细分析技术的最后一章(或计算机程序—其实两者是等价的),我们建议直接从CD-ROM中下载,确认并实际在TradeStation运行。将每章彻底地弄明白后再转入下一章。
    我们希望读者能喜爱这本书,更希望此书能帮读者发现TradeStation的强大威力和启迪读者的创造与想象。
    祝大家好运
    祝大家交易顺利
     
  6. Fundamenttals

    WHAT IS EASYLANGUAGE?

    When you code (slang for writing your ideas into a programming language) an analysis technique, you are directing the computer to follow your instructions to the tee. A computer language is nothing but a list of instructions. A computer is obedient and speedy , but it is only as smart as its programmer. In addition, the computer requires that its instructions to be in exact format. A programmer must follow certain syntax rules.
    EASYLANGUAGE is the medium used by traders to convert a trading idea into a form that a computer can understant. Fortunately for the programmers, Easylanguage is a high level language; it look like the written English language. It is a compiled language; programs are converted to computer code when the programmer deems necessary. The compiler then checks for syntactical correctness and translates your source code into a program that the computer can understand. If there is a problem, the compiler alerts the programmer and sometimes offers advice on how to fix it. That is a different than a translated language, which evaluates every line as it is typed.
     
  7. All computer languages, including EasyLanguage, have several things in common. They all have:

    . Reserved Words. Words that the computer language has set aside for a specific purpose. You can only use these words for their predefined purposes. Using these words for any other purpose may cause severe problems. (See the list of reserved words in Appendix C)
     
  8. Re: Fundamenttals


    基础
    什么是EASYLANGUAGE?
    当你为一项分析技术编码时(也即俗话讲的将交易思想转为编程语言),其实是在指示计算机按照你的指令工作。计算机语言就只是一个指令清单。计算机是被动的但却是快速的,它与给它编写程序的程序员一样聪明。另外,计算机的指令要按照一定的格式来完成,而程序员也必须遵循一定的语法规则。
    EASYLANGUAGE是程序员将交易思想转换成计算机能理解的形式(语言)的中介。幸运的是,EASYLANGUAGE是一种高级语言,但它看起来与书面英语一样。EASYLANGUAGE是一种编译语言,当程序员认为需要的时候程序就会被转换成计算机代码。于是编译器开始检查语法上的正确性并将代码转换成计算机能理解的程序。当发现错误时,编译器还能向程序员指示出问题所在,有时还能提出解决方案。这就是与解释语言的区别,解释语言是在输入的时候进行评估的。
     
  9. 包括EasyLanguage在内的所有计算机语言都有一些共同的地方,比如:
    。保留字: 计算机留出来作为特殊用途的字(词汇)。用户只能按预定义的方式来使用这些字。将这些字作它用时会导致计算机十分严重的错误。(参见附录C的保留字清单)
     
  10. 。Remarks. Words or statements that are completely ignored by the compiler. Remarks are placed in code to help the programmers or other people who may reuse the code, understand what the program is designed to do. EasyLanguage also utilizes skip words. These words are included in a statement to make the programming easier to read. For example, Buy on next bar at myPrice stop is the same as Buy next bar myPrice stop. The words on and at are completely ignored.(See the list of skip words in the appendix C.)
    . Varaibles. User- defined words or letters that are used to store information.
    .Data Type. Different types of storage; variables are defined by their data types. EasyLanguage has three basic data types: Numeric, Boolean, and String. A variable that is assigned a Numeric value, or stored as a number, would be of the Numeric type. A variable that stores a true or false value would be of the Boolean type. Finally, a variable that stores a list of characters would be of the String type.
     
  11. Variable and Data Types
    A programmer must understand how to use variables and their associated data types before they can program anything productive. Let’s take a look at a snippet of code.
    MySum =4+5+6;
    MyAvg =MySum/3;
    The variables in this code are mysum and myAvg and they are of the Numeric data type; they are storage places for numbers. EasyLanguage is liberal concerning variable names, but there are a few requirements. A variable name conot
    . start with a number or a period(.)
    . be a number
    . be more than 20 alphanumeric characters long
    . include punctuation other than the period(.) or underscore(_)
     
  12. .注释。 被编译器完全忽视掉的词汇与语句。放在代码中的注释是为帮助编程人员或代码的再使用者理解程序的功能。EasyLanguage也采用空指令词汇。包括在句子中的这些空指令词汇能使程序员更容易地阅读程序。例如,Buy on next bar at myPrice stop 与 Buy next bar myPrice stop 等效。单词on 与at 就被编译器忽略了。
    (空指令词汇参见附录C的清单)
    。变量 用户定义的用于存储信息的词汇或字母。
    。数据类型 不同的存储类型;变量是根据数据类型来定义的。EasyLanguage有三种基本的数据类型:数字,布尔,字符串。分配成数字量或存储为数字的变量就是数字型变量。存储真值或假值的变量就是布尔型变量。存储一串字母的变量就是字符型变量。
     
  13. 。变量与数据类型
    在进行编程之前,程序员必须理解变量和与之相关的数据类型。看一段如下的代码:
    MySum =4+5+6;
    MyAvg =MySum/3;
    其中mysum 和睦myAvg都是变量且为数字型变量;它们都是存储数字的地方。EasyLanguage对于变量的命名是相当宽松的,但也要遵循一定的规定。一个变量名不能
    。 以一个数字或句号开头
    。 是一个数字
    。 长于20个数字字符
    。 包括诸如句号或下划线一类的标点符号。
     
  14. 请问可以提供本书的下载吗?
     
  15. 告诉你了,你愿加入翻译吗?一天翻一页。
     
  16. Correct Incorrect
    myAvg 1MyAvg
    mySum .sum
    sum val+11
    vall the//sum
    the.sum my?sum
    my_val 1234
    Variable naming is up to the style of individual programmer. EasyLanguage is not case sensitive (you can use upper or lowercase letters in the variable names). (Note: This is our preference---may not be everybody’s.) Lowercase letters are preferred for names that only contain one syllable. For variable names that have more than one syllable, we begin the name with a lowercase letter and then capitalize the beginning of each subsequent syllable.
    Sum , ave, total, totalSum, myAvg, avgValue, totalUpsum,totDnAvg
    Still referring to the previous snippet of code, mySum is assigned the value of 15 and myAvg is assigned the value of 15/3 or 5. If a variable name is created, it must be declared ahead of time. The declaration statement defines the initial value and data type of the variable. The compiler needs to know how much space to reserve in memory for all variables. The following code is a complete EasyLanguage program.(Note: Most of the code that you will see in this book will be particular to EasyLanguage and will probably not work in any other language.)
    Vars: mySum(0), myAvg(0);
    mySum= High + Low + Close;
    myAvg = mySum/3;
    The Vars: (or Variables:) statement tells the computer what variables are being declared and initialized. We declare the variables by simply listing them in the Vars statement and initialize them by placing an initial value in parentheses following the variable name. In this case, mySum and myAvg are to be equal to zero. EasyLanguage is smart enough to realize that these variables should be of the Numeric data type, since we initialized then with numbers. Variable names should be self-descriptive and long enough to be meaningful. Which of the following is more selt-explanatory?
    mySum =High + low + Close; or k = High + Low +Close;
    myAvg = mySum/3; j = k/3 ;
    Buypt = Close + myAvg ; l = Close + j ;
     
  17. 正确的写法 错误的写法
    myAvg 1MyAvg
    mySum .sum
    sum val+11
    vall the//sum
    the.sum my?sum
    my_val 1234
    变量命名多取决于程序员的个人风格。EasyLanguage 是非大小写敏感的语言(即在变量的命名中可用大写也可用小写意思一样)。(注:这只是我们的偏好,其它的语言也许不这样。)当变量名仅有一个音节时,我们倾向于用小写。当变量名多于一个音节时,我们将在开始的第一个音节用小写而在随后的各个音节的第一个字母用大写。
    Sum , ave, total, totalSum, myAvg, avgValue, totalUpsum,totDnAvg
    参看前面的那段代码,mySum 被分配了值15,myAvg被赋了值15/3 或者说5。当创建变量名时,一定要提前申明。申明语句中定义了变量的初始值与数据类型。编译器了解了变量的类型后才能为变量在内存中保留合适的字节。随后的代码完全是EasyLanguage式的(注:读者在此书中看到的代码绝大多数都属EasyLanguage,他们在其它语言中也许不能正常运行。)
    Vars: mySum(0), myAvg(0);
    mySum= High + Low + Close;
    myAvg = mySum/3;
    The Vars: (或 变量)申明语句告诉计算机申明的变量及其初值。将变量名列于the Vars后并将初始值放于随后的圆括号中就可以申明变量了。在此例中,变量mySum 和myAvg 都等于0。因为初始值是数字,EasyLanguage 有足够的智能自动地识别出这些变量的数据类型。变量名应该是自描述性的而且应有一定的长度使其变量名有些提示意义。下面这些变量名够长且具自释性吗?
    mySum =High + low + Close; or k = High + Low +Close;
    myAvg = mySum/3; j = k/3 ;
    Buypt = Close + myAvg ; l = Close + j ;
     
  18. 很想加入翻译 这样也有利于我的学习,不过我的英文水平实在太菜了,只可勉强自己看懂,是否可以给予一定帮助?
     
  19. 可以啊,将译文传上,共同研读啊。
    不过翻译水平还是LP77的高。可向他咨询。
     
  20. 2005-7-28 抄录
    Variables of Boolean and String types are declared in a similar fashion.
    Vars: myCondition(false) , myString(“abcdefgh ”) ;
    The variable myCondition was initialized to false. The word false is a reserved word that has the value of zero. This word cannot be used for any other purpose. The variable myString was initialized to abcdefgh. Sometimes you will need to use a variable for temporary purposes and it is difficult to declare and initialize all of your variables ahead of time. In the case of a temporary variable (one that holds a value for a short period of time), EasyLanguage has declared and initialized several variables for your use; value0 through value99 have been predefined and initialized to zero and are ready for usage in your programs. The following is a complete EasyLanguage program:
    value1 = High + Low + Close ;
    value2 =(High + Low)/2.0 ;
    Notice there isn’t a Vars statement. Since value1 and value2 are predefined, the statement isn’t needed. You have probably noticed the semicolon (;) at the end of each line of code. The semicolon tells the compiler that we are done with this particular instruction. In programming jargon, instructions are known as statements. Statements are made up of expressions, which are made up of constants, variables, operators, functions, and parentheses. Some languages need a termination symbol and others do not . EasyLanguage needs the statement termination symbol. Remember to put a semicolon at the end of each line to prevent a syntax error.
    Input are similar to variables. They follow the same naming protocol and are declared and initialized. However, an input remains constant throughout an analysis technique. An input cannot start a statement (a line of instruction) and cannot be modified within the body of the code. One of the main reasons for using inputs is that you can change input values of applied analysis techniques without having to edit the actual EasyLanguage code. Inputs would be perfect for a moving average indicator. When you plot this indicator on a chart, you simply type in the length of the moving average into the input box of the dialog box. You don’t want to have to go back to the moving average source code and change it and then verify it. Also, when used in trading strategies, inputs allow you to optimize your strategies. This is discussed in Chapter 5.
    Notice how inputs and variables are declared in similar style.
    Inputs : length1(10), length2(20), flag(false);
    Vars: myLength1(10) , myAveVal(30) ;
    However, notice how they are used differently in coding.