(注:我想以上的30分钟的周期为:9:30、10:00、10:45、11:15、13:45、14:15、14:45、15:00这几个时间段的最高点、最低点作为买卖依据,请问以下程序怎么调整?)
//《30分钟日内反转系统》
//使用周期1分钟图表
//
//准备需要的中间变量
h30:=ref(hhv(h,30),1);
L30:=ref(llv(L,30),1);
//画出多头的止损线
partline(holding>0,L30,colorred);
//建立多头的进场条件
long:=h>h30 and time>093000 and time<145200;
if long then
begin
sellshort(holding<0,holding,limitr,h30);
buy(holding=0,20,limitr,h30);
end
//建立空头的进场条件
short:=L<L30 and time>093000 and time<145200;
if short then
begin
sell(holding>0,0,limitr,L30);
buyshort(holding=0,20,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;