[求助]能把这个模型改成一分钟用的吗 [金字塔]
- 咨询内容:
能把这个模型改成股指一分钟用的吗?
variable:zs=c,maxhl=c;
//把以上顾比线的代码复制一下
DISTL:=NEWLBARS(L,1);
DISTH:=NEWHBARS(H,1);
HI20:=REF(HHV(H,20),1);
LO20:=REF(LLV(L,20),1);
GBD1:=REF(L,DISTL);
GBD2:=REF(GBD1,DISTL);
GBD:=IF(GBD2>0,MAX(LLV(L,20),GBD2),LLV(L,20));GBG1:=REF(H,DISTH);
GBG2:=REF(GBG1,DISTH);
GBG:=IF(GBG2>0,MIN(HHV(H,20),GBG2),HHV(H,20));
nn:=barslast(date<>ref(date,1))+1;
entertime:=nn>=m and time<=144500;
exittime:=time>=150900;
if holding>0 then 止损1:zs;
if holding<0 then 止损2:zs;
ma5:=ma(c,5);
ma30:=ma(c,30);
long:=cross(ma5,ma30);//多单进场条件
short:=cross(ma30,ma5);//空单进场条件//下破移动止损线后离场
if holding>0 and (c<zs or exittime) then sell(1,1,limitr,c);
if holding<0 and (c>zs or exittime) then sellshort(1,1,limitr,c);//开仓语句
if holding=0 and entertime and long then begin
buy(1,1,limitr,c);
zs:=gbd;//调用顾比倒数线做为止损
maxhl:=h;//记录当时的高点
endif holding=0 and entertime and short then begin
buyshort(1,1,limitr,c);
zs:=gbg;//调用顾比倒数线做为止损
maxhl:=L;
endif holding<0 and l<maxhl then begin //创新低后,重新定位离场位,以实现浮动止损
maxhl:=l;
zs:=gbg;
endif holding>0 and h>maxhl then begin //创新高后,重新定位离场位,以实现浮动止损
zs:=gbd;
maxhl:=h;
end - 金字塔客服:
图表交易系统,你放在1分钟K线上,它就是一分钟的模型了,这需要改什么??
- 用户回复:
发错了应该是这个
input:lots(1,0,100,1);
variable:N1=1;
i_offset:=N1*MINDIFF;
D1 := llv(REF(Low,2),22); //求1个月最低价
D2 := hhv(REF(High,2),22); //求1个月最高价
D3 := IntPart(0.008*ref(Open,1)); //昨日开盘价的0.8%
Condition1 := (REF(LOW,1)<=D1 OR REF(LOW,2)<=D1 OR REF(LOW,3)<=D1) And (REF(Open,1)-REF(CLOSE,1))>=D3; //判断反转日,由多转空
Condition2 := (REF(HIGH,1)>=D2 OR REF(HIGH,2)<=D2 OR REF(HIGH,3)<=D2) And (REF(CLOSE,1)-REF(Open,1))>=D3; //判断反转日,由空转多if Condition2 then
begin
if holding=0 then
BEGIN
buy(1,lots,limitr,(Open+i_offset));
end
if holding<0 then
begin
SELLSHORT(1,0,limitr,(Open+i_offset));
buy(1,lots,limitr,(Open+i_offset));
end
endif Condition1 then
begin
if holding=0 then
BEGIN
BUYSHORT(1,lots,limitr,(Open-i_offset));
endif holding>0 then
begin
SELL(1,0,limitr,(Open-i_offset));
BUYSHORT(1,lots,limitr,(Open-i_offset));
end
end
//资产:asset,noaxis,colorred,linethick2;
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 1145508240 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容