你好:这是我现在的模型,我想实现开盘价在OEE4之上只开多,平多。在OEE4之下只开空,平空。请详细的帮我写一下公式。谢谢
现在我的开平条件和公式
//开多
IF kdtj THEN
BEGIN
sellshort(holding<0,holding, THISCLOSE);//检查是否有空单,若有,市价平掉已有空单
buy(holding=0,1,THISCLOSE);
END
IF kktj THEN
BEGIN
SELL(holding>0,holding,THISCLOSE);
BUYSHORT(holding=0,1,THISCLOSE);
END
IF kktj and open<oee4 THEN
BEGIN
SELL(holding>0,holding,THISCLOSE);
BUYSHORT(holding=0,1,THISCLOSE);
END
我这样把它分别分开来写你看看可以吗?
//开多条件
kdtj:= L1>ref(L1,60) and gg2 and open >HEE4+10;
//开多
IF kdtj THEN
BEGIN
sellshort(holding<0,holding, THISCLOSE);//检查是否有空单,若有,市价平掉已有空单
buy(holding=0,1,THISCLOSE);
END
//平多条件
pdtj:= h1<ref(h1,60) AND OO<REF(OO,60) and gg2 and OPEN >HEE4;
//平多
IF pdtj THEN
BEGIN
sellshort(holding<0,holding, THISCLOSE);//检查是否有空单,若有,市价平掉已有空单
SELL(holding>0,holding,THISCLOSE);
END
//开空条件
kktj:={ h1<ref(h1,60) AND }OO<REF(OO,60) {and gg2 and open <LEE4-10};
IF kktj THEN
BEGIN
SELL(holding>0,holding,THISCLOSE);
BUYSHORT(holding=0,1,THISCLOSE);
END
//平空条件
pktj:= {L1>ref(L1,60) AND }OO >ref(OO,60) {and gg2 and open<LEE4 };
//平空
IF pktj THEN
BEGIN
SELL(holding>0,holding,THISCLOSE);
sellshort(holding<0,holding, THISCLOSE);//检查是否有空单,若有,市价平掉已有空单
END