以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://www.weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://www.weistock.com/bbs/list.asp?boardid=4) ---- 语句未尾缺少分号 (http://www.weistock.com/bbs/dispbbs.asp?boardid=4&id=11619) |
||
-- 作者:wiffrey -- 发布时间:2012/5/10 17:01:43 -- 语句未尾缺少分号
例三:30分钟翻转系统 //《日内30分钟翻转系统》 //适用于1分钟周期 //编写日期:20100812-JYL
//准备需要的中间变量 h30 := ref(hhv(h,30),1); l30 := ref(llv(l,30),1);
//建立多头的进场条件 long := h>h30 and time>093000 and time<145000;
if long then begin sellshort(holding < 0, 0, limitr, h30); buy(holding = 0, 1, limitr, h30); end
//画出多头的止损线 partline(holding>0, l30,colorred);
//开空条件 short := l < l30 and time > 093000 and time < 145000;
if short then begin sell(holding > 0, 0, limitr, l30); buyshort(holding = 0, 1, limitr, l30); end
//画出空头的止损线 partline(holding<0, h30, colorgreen);
//收盘前5分钟平仓 if time > 145500 then begin sell(holding > 0, 0, thisclose); sellshort(holding < 0, 0, thisclose); end
|
||
-- 作者:just -- 发布时间:2012/5/10 17:08:49 -- if con1 and holding=0 then beign 这里的begin重新用英文状态下输入一次 |
||
-- 作者:Leon -- 发布时间:2012/5/10 17:08:52 -- con1楼主没定义,我假定con1:=1; variable:a=0; begin a:=h; end if h>a then sell(holding>0,0,market); //《日内30分钟翻转系统》 //适用于1分钟周期 //编写日期:20100812-JYL
//准备需要的中间变量 h30 := ref(hhv(h,30),1); l30 := ref(llv(l,30),1);
//建立多头的进场条件 long := h>h30 and time>093000 and time<145000;
if long then begin sellshort(holding < 0, 0, limitr, h30); buy(holding = 0, 1, limitr, h30); end
//画出多头的止损线 partline(holding>0, l30,colorred);
//开空条件 short := l < l30 and time > 093000 and time < 145000;
if short then begin sell(holding > 0, 0, limitr, l30); buyshort(holding = 0, 1, limitr, l30); end
//画出空头的止损线 partline(holding<0, h30, colorgreen);
//收盘前5分钟平仓 if time > 145500 then begin sell(holding > 0, 0, thisclose); sellshort(holding < 0, 0, thisclose); end |
||
-- 作者:wiffrey -- 发布时间:2012/5/10 17:36:29 -- 谢谢
|