Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共3 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:[求助]ref与if

1楼
zzzlondon 发表于:2011/10/20 16:32:02

 

if barpos>30 then begin
 buy(holding=0 and close>ref(close,10)+3,1,thisclose);
 sell(holding=1 and close<ref(close,10)-3,1,thisclose);
end

 

这样写编译报错:ref在逐K线不能直接在控制语句之内引用

 

if barpos>30 and close>ref(close,10)+3 then begin
 buy(holding=0,1,thisclose);
end

 

这样写却没有问题,具体是什么原理?帮助里没找到

2楼
26327756l 发表于:2011/10/20 16:42:16
不知道什么原理,只知道就这样解决。
3楼
阿火 发表于:2011/10/20 21:42:13

统计类函数,可能会有无效值,不能放在 if then 语句

就当这是金字塔的语法。不要触碰“法”,否则“坐牢”

共3 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.01501 s, 3 queries.