Board logo

标题: multicharts基础编程 第013节 循环语句(For...... Begin ...... End循环) [打印本页]

作者: 龙听    时间: 2023-9-13 19:23     标题: multicharts基础编程 第013节 循环语句(For...... Begin ...... End循环)

[mp4]http://mp4.qhlt.club/mcode/013.mp4[/mp4]
作者: 龙听    时间: 2023-9-13 19:27

程式码部分
  1. var:barsbackno(0),highpricesum(0);

  2. barsbackno = 0 ;
  3. highpricesum = 0 ;
  4. {
  5. while barsbackno < 10 begin //cal
  6. highpricesum = highpricesum + Close[barsbackno];
  7. barsbackno = barsbackno +1 ;
  8. end;
  9. }

  10. for barsbackno = 0 to 9 begin
  11. highpricesum = highpricesum + Close[barsbackno];
  12. end;

  13. print(highpricesum/10);

  14. value1 = tl_new(date[1],time[1],highpricesum[1]/10,date,time,highpricesum/10);
复制代码

作者: 龙听    时间: 2023-9-13 19:39

  1. var:barsbackno(0),highpricesum(0);

  2. barsbackno = 0 ;
  3. highpricesum = 0 ;
  4. {
  5. while barsbackno < 10 begin //cal
  6. highpricesum = highpricesum + Close[barsbackno];
  7. barsbackno = barsbackno +1 ;
  8. end;
  9. }
  10. {for barsbackno = 0 to 9 begin
  11. highpricesum = highpricesum + high[barsbackno];
  12. end;
  13. }

  14. for barsbackno = 9 downto 0 begin
  15. highpricesum = highpricesum + high[barsbackno];
  16. end;

  17. print(highpricesum/10);

  18. value1 = tl_new(date[1],time[1],highpricesum[1]/10,date,time,highpricesum/10);
复制代码

作者: 龙听    时间: 2023-9-18 19:54

multicharts量化课程网课PPT下载:http://www.qhlt.cn/thread-143956-1-1.html




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