
等级: 标准版
- 注册:
- 2021-9-1
- 曾用名:
|

楼主 |
发表于 2021-10-15 10:48
|
显示全部楼层
开仓条件输出为0,代码如果去掉引用那段就可以正常,难道是引用出了问题?完整代码如下:
//参数
input:周期参数(35,10,50,1);
手数:=CEILING((7*(100000))/(c*MULTIPLIER)),linethick0;
持仓量:=50000;
日多空线:STKINDI('','引用指标.多空线',0,6,0),NODRAW;
日ma10:STKINDI('','引用指标.ma10',0,6,0),NODRAW;
多空线:=50-((100 * (hhv(h,周期参数) - C))/ (HHV(h,周期参数) - LLV(l,周期参数))),NOAXIS;
//平仓
if holding<0 and 多空线>0 then BEGIN
平空:SELLSHORT(1,0,LIMITR,c);
END
if holding>0 and 多空线<0 then BEGIN
平多:sell(1,0,LIMITR,C);
END
//开仓
if REF(OPENINT,1)>持仓量 and holding=0 and 多空线>30 and 日多空线>30 and o>日ma10 then begin
开多:BUY(1,手数,LIMITR,C);
END
IF REF(OPENINT,1)>持仓量 and holding=0 and 多空线<-30 and 日多空线<-30 and o<日ma10 then BEGIN
开空:BUYSHORT(1,手数,LIMITR,c);
END
资产:ASSET-1000000,NOAXIS,linethick3,COLORBROWN; |
|