Rss & SiteMap

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

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

标题:代码错误

1楼
厦门股指期货 发表于:2011/4/1 16:39:35
开多 BUY((CLOSE-CB2)<15,10,THISCLOSE),TFILTER 提示说左括号不完整
2楼
董小球 发表于:2011/4/1 17:00:43
应该是你最后少了分号的缘故
3楼
fly 发表于:2011/4/1 17:30:40

TFILTER函数.

用于交易系统公式ENTERLONG, EXITLONG, ENTERSHORT, EXITSHORT后,以ENTER和EXIT为间隔,过滤连续的同种信号.

 

不要把TFILTER用于BUY系统过滤信号.

BUY系统的可以用HOLDING,可参考以下写法

//用于1分钟K线

ma5:ma(close,5);
ma15:ma(close,15);

a1:asset,linethick0;
if CROSS(ma5,ma15) and time>090100 and time<145000 then
begin
sellshort(holding<0,1,thisclose);
buy(holding=0,1,limit,c);
end

if CROSS(ma15,ma5) and time>090100 and time<145000 then
begin
sell(holding>0,1,thisclose);
buyshort(holding=0,1,limit,c);
end

//收盘前5分钟平仓
if time > 145500 then
 begin
 sell(holding > 0, 0, thisclose);
 sellshort(holding < 0, 0, thisclose);
 end

[此贴子已经被作者于2011-4-1 17:30:59编辑过]
共3 条记录, 每页显示 10 条, 页签: [1]


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