Board logo

标题: 语句 [打印本页]

作者: 龙听    时间: 2017-11-2 13:11     标题: 语句

一个语句代表一个完全的指示或描述,语句中包含有保留字、操作符、符号。并且语句总是以";"作为语句结束的标志。
以下为语句的一些例子:

  1. This is one statement;

  2. This is another statement;

  3. This is
  4. one statement;

  5. This is
  6. another
  7. statement
  8. ;

  9. This is yet another;

  10. This is one statement;This is another;
复制代码



赋值语句
赋值语句用于给公式变量指定一个具体的值的语句,赋值语句使用赋值操作符(=)进行处理。
以下为赋值语句的一些例子:


  1. Vars
  2.     Bool b;
  3. Begin
  4.     B = true;
  5.     ...
  6. End
  7. Vars
  8.     Numeric Value1;
  9. Begin
  10.     Value1 = (Close + Open)/2;
  11.     ...
  12. End
  13. Vars
  14.     String str;
  15. Begin
  16.     str ="It Is A Test!";
  17.     ...
  18. End
复制代码



变量在赋值的时候忽略其扩展数据类型,只考虑其基本数据类型,即NumericSeries,NumericRef,Numeric之间可以相互赋值。此时序列数据类型只是对当前Bar的值进行操作。




欢迎光临 龙听期货论坛 (http://www.qhlt.cn/) Powered by Discuz! 7.2