Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共3 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:帮忙检查下程序

1楼
chockstick 发表于:2013/5/30 13:44:55

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周期上

2楼
jinzhe 发表于:2013/5/30 13:50:17

公式中下单函数的价位参数写错了

要么是buy(cond,vol,limitr,open);

要么是buy(cond,vol,market);

写成buy(cond,vol,open);是不对的

3楼
chockstick 发表于:2013/5/30 13:56:35
是的噢。。谢谢啦
共3 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.07813 s, 3 queries.