等级: 专业版
- 注册:
- 2022-1-11
- 曾用名:
|
楼主 |
发表于 2022-2-7 10:59
|
显示全部楼层
下面是一分钟的开平仓代码:
KD:= BIGUPTT1>=11 AND DIFFHF>=1 AND DIFF1>=2;//开多条件
PD:= MACDHF<0 OR (DIFF3>=5 AND MACD_UP3=0) OR (DIFF2>=3 AND MACD_UP2=0) OR (DIFF1>=2 AND MACD_UP1=0);
KK:= BIGDNTT1>=11 AND DIFFHF<=-1 AND DIFF1<=-2;//开空条件
PK:= MACDHF>0 OR (DIFF3<=-5 AND MACD_DOWN3=0) OR (DIFF2<=-3 AND MACD_DOWN2=0) OR (DIFF1<=-2 AND MACD_DOWN1=0);
TSELL(PK,0,MKT,0,0,'','10003925'); //平空信号
TBUY(KD AND TBUYHOLDINGEX('','10003917',2)=0,5,MKT,0,0,'','10003917'); //开多信号
TSELL(PD,0,MKT,0,0,'','10003917'); //平多信号
TBUY(KK AND TBUYHOLDINGEX('','10003925',2)=0,5,MKT,0,0,'','10003925'); //开空信号
下面是两分钟的开平仓代码:
KD:= BIGUPTT2 >=11 AND DIFFHF>=2 AND DIFF1>=3;//开多条件
PD:= MACDHF<0 OR (DIFF3>=8 AND MACD_UP3=0) OR (DIFF2>=5 AND MACD_UP2=0) OR (DIFF1>=3 AND MACD_UP1=0);
KK:= BIGDNTT2>=11 AND DIFFHF<-2 AND DIFF1<-3;//开空条件
PK:= MACDHF>0 OR (DIFF3<=-8 AND MACD_DOWN3=0) OR (DIFF2<=-5 AND MACD_DOWN2=0) OR (DIFF1<=-3 AND MACD_DOWN1=0);
TSELL(PK,0,MKT,0,0,'','10003738'); //平空信号
TBUY(KD AND TBUYHOLDINGEX('','10003729',2)=0,5,MKT,0,0,'','10003729'); //开多信号
TSELL(PD,0,MKT,0,0,'','10003729'); //平多信号
TBUY(KK AND TBUYHOLDINGEX('','10003738',2)=0,5,MKT,0,0,'','10003738'); //开空信号
能不能帮忙按照上面的模板写一个范例来实现这个功能?
指标名称分别是MDJ1和MDJ2. |
|