参考如下的写法,请尽量遵循这个模版。
视频讲座里面也有例子
//《30 分钟的日内翻转系统》
//适用于1分钟图表
//Designed by LIKAI
//QQ=475049
//准备需要的中间变量
h30:= ref(hhv(h,30),1);
l30:=ref(llv(l,30),1);
//建立多头的进场的条件
Long:= h>h30 and time>093000 and time < 145200 ;
if Long then
begin
sellshort(holding<0, holding, limitr, h30) ;
buy(holding=0, 1, limitr, h30) ;
end
//画出多头的止损线
partline(holding>0, l30, colorred) ;
//建立空头的进场条件
Short:= l<l30 and time>093000 and time < 145200 ;
if Short then
begin
sell(holding>0, 0, limitr, l30) ;
buyshort(holding=0, 1, limitr, l30) ;
end
//画出空头的止损线
partline(holding<0, h30, colorgreen);
//收盘前平仓
sell(time>145500 and holding>0, 0, thisclose) ;
sellshort(time>145500 and holding<0,0,thisclose) ;
资产:ASSET,LINETHICK0;
可用现金:CASH(0),LINETHICK0;
持仓:HOLDING,LINETHICK0;
[此贴子已经被作者于2009-12-10 10:07:43编辑过]