龙听期货论坛's Archiver

C
+
+


 微信: QQ:

龙听 发表于 2023-9-13 19:23

multicharts基础编程 第013节 循环语句(For...... Begin ...... End循环)

[mp4]http://mp4.qhlt.club/mcode/013.mp4[/mp4]

龙听 发表于 2023-9-13 19:27

程式码部分
[code]
var:barsbackno(0),highpricesum(0);

barsbackno = 0 ;
highpricesum = 0 ;
{
while barsbackno < 10 begin //cal
highpricesum = highpricesum + Close[barsbackno];
barsbackno = barsbackno +1 ;
end;
}

for barsbackno = 0 to 9 begin
highpricesum = highpricesum + Close[barsbackno];
end;

print(highpricesum/10);

value1 = tl_new(date[1],time[1],highpricesum[1]/10,date,time,highpricesum/10);
[/code]

龙听 发表于 2023-9-13 19:39

[code]var:barsbackno(0),highpricesum(0);

barsbackno = 0 ;
highpricesum = 0 ;
{
while barsbackno < 10 begin //cal
highpricesum = highpricesum + Close[barsbackno];
barsbackno = barsbackno +1 ;
end;
}
{for barsbackno = 0 to 9 begin
highpricesum = highpricesum + high[barsbackno];
end;
}

for barsbackno = 9 downto 0 begin
highpricesum = highpricesum + high[barsbackno];
end;

print(highpricesum/10);

value1 = tl_new(date[1],time[1],highpricesum[1]/10,date,time,highpricesum/10);
[/code]

龙听 发表于 2023-9-18 19:54

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

页: [1]