选股公式问题 [金字塔]
-
咨询内容:
老师,麻烦把下面的改成选股公式。谢谢
//策略名:MACD背离模型
//类型:股票t+0
//适用:后台程序化
//使用市场:个股DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA),COLORSTICK;N:=BARSLAST(CROSS(DIFF,DEA))+1;
N1:=BARSLAST(CROSS(DEA,DIFF))+1;
DIFF1:=REF(REF(DIFF,N-1),1);
DIFF2:=REF(REF(DIFF,N1-1),1);
C1:=REF(REF(C,N-1),1);
C2:=REF(REF(C,N1-1),1);
DBL1:=DIFF > DIFF1 AND CROSS(DIFF,DEA) AND C >C1; //底背离
DBL:=DIFF<DIFF2 AND CROSS(DEA,DIFF) AND C < C2; //顶背离
TBUY(DBL1 AND TNUMLOSSTRADE < 2,100,MKT);
TSELL(DBL AND TBUYHOLDINGEX('','',2) > 0,100,MKT);
TSELL(EVERY(C <= REF(C,1),5),0,MKT); -
金字塔客服:
你这没啥好改的啊。只需要去掉后台交易语句把交易的条件作为选股条件就行了。
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA),COLORSTICK;
N:=BARSLAST(CROSS(DIFF,DEA))+1;
N1:=BARSLAST(CROSS(DEA,DIFF))+1;
DIFF1:=REF(REF(DIFF,N-1),1);
DIFF2:=REF(REF(DIFF,N1-1),1);
C1:=REF(REF(C,N-1),1);
C2:=REF(REF(C,N1-1),1);
DBL1:DIFF and DIFF1 AND CROSS(DIFF,DEA) AND C and C1; //底背离
DBL:DIFF and DIFF2 AND CROSS(DEA,DIFF) AND C and C2; //顶背离
按照交易语句的思路是底背离买入,那你选股时候选择 DBL1作为选股条件即可。 [此贴子已经被作者于2020/9/1 14:44:29编辑过]
有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友
可联系技术人员 QQ: 262069696 或微信号:cxh99cxh99 进行 有偿收费 编写!
(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
相关文章
-
没有相关内容