帮忙检查下程序 [金字塔]
- 咨询内容:
DayVarValue1:ma(close,5);//
DayVarValue2:ma(close,10);
//开仓条件
DayIntervalValue:=DayVarValue1-DayVarValue2;
KD:=ref(low,1)<DayVarValue2 and ref(close,1)>=DayVarValue2 and date>=1120101 and time<=143000 ; //开多条件
//PD:=ref(close,1)>=(DayVarValue2+0.5*DayIntervalValue); //平多条件
PD:=(ref(close,1)>=(DayVarValue2+ratio*DayIntervalValue)) or (ref(close,1)<DayVarValue2 and ref(close,2)<DayVarValue2);
KK:=ref(high,1)>DayVarValue1 and ref(close,1)<DayVarValue1 and date>=1120101 and time<=143000; //开空条件
PK:=(ref(close,1)<=(DayVarValue1-0.5*DayIntervalValue)) or (ref(close,1)>DayVarValue1 and ref(close,2)>DayVarValue1); //平空条件
//PD:=(ref(close,1)>=(DayVarValue2+ratio*DayIntervalValue)) or (ref(close,1)<DayVarValue2 and ref(close,2)<DayVarValue2);BUY(KD AND HOLDING=0,1,OPEN); //开多信号
SELL(HOLDING>0 AND PD,1,OPEN); //平多信号
BUYSHORT(KK AND HOLDING=0,1,OPEN); //开空信号
SELLSHORT(holding<0 AND PK,1,OPEN); //平空信号if time>=150000 then begin
sell(holding>0,1,market);
sellshort(holding<0,1,market);
end----------------------------------------------------
测试正常,为什么没信号出来?股指连续5min周期上
- 金字塔客服:
公式中下单函数的价位参数写错了
要么是buy(cond,vol,limitr,open);
要么是buy(cond,vol,market);
写成buy(cond,vol,open);是不对的
- 用户回复: 是的噢。。谢谢啦
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 1145508240 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容