请老师把三个相似程序整合 [文华财经]
- 咨询内容:
麻烦老师把如下三个相似的程序整合在一起,若其中一个程序开仓后未平仓,则另两个程序也不得开仓。区别是标记红色的语句。
程序A
MA5:MA(C,5);
N:=BARSLAST(DATE<>REF(DATE,1))+1;
NN:=REF(N,N);
M1:=REF(C,N);//昨天的收盘价为M1
M2:=REF(C,N+NN);//前天的收盘价为M2
M3:=REF(C,N+2*NN);//大前天的收盘价为M3
M4:=REF(C,N+3*NN);//前4天的收盘价为M4
M:IFELSE(M1>=M2&&M2>=M3||M1<=M2&&M2<=M3,M2,IFELSE(M2>=M1&&M1>=M3||M2<=M1&&M1<=M3,M1,
IFELSE(M2>=M3&&M3>=M1||M2<=M3&&M3<=M1,M3,
IFELSE(M3>=M1&&M1>=M2&&M2>=M4||M3<=M1&&M1<=M2&&M2<=M4,M1,NULL))));
COUNT(BARSBK=1||BARSSK=1,N)<100+1&&(ISLASTBP||NOT(BARSBK>=1)&&NOT(BARSSK>=1))&&(C>M+0.7||C>M),BK;
COUNT(BARSBK=1||BARSSK=1,N)<100+1&&(ISLASTSP||NOT(BARSBK>=1)&&NOT(BARSSK>=1))&&(C<M+0.7||C<M),SK;
C>=BKPRICE+3||C<=BKPRICE-5&&MA5<REF(MA5,1),SP;
C>=SKPRICE+5||C<=SKPRICE-3&&MA5>REF(MA5,1),BP;
AUTOFILTER;
MONO_SIGNAL;
- 文华技术人员:
程序B
MA5:MA(C,5);
N:=BARSLAST(DATE<>REF(DATE,1))+1;
NN:=REF(N,N);
M1:=REF(C,N);//昨天的收盘价为M1
M2:=REF(C,N+NN);//前天的收盘价为M2
M3:=REF(C,N+2*NN);//大前天的收盘价为M3
M4:=REF(C,N+3*NN);//前4天的收盘价为M4
M:IFELSE(M1>=M2&&M2>=M3||M1<=M2&&M2<=M3,M2,IFELSE(M2>=M1&&M1>=M3||M2<=M1&&M1<=M3,M1,
IFELSE(M2>=M3&&M3>=M1||M2<=M3&&M3<=M1,M3,
IFELSE(M3>=M1&&M1>=M2&&M2>=M4||M3<=M1&&M1<=M2&&M2<=M4,M1,NULL))));
COUNT(BARSBK=1||BARSSK=1,N)<100+1&&(ISLASTBP||NOT(BARSBK>=1)&&NOT(BARSSK>=1))&&(C>(M+30)+0.7||C>(M+30)),BK;
COUNT(BARSBK=1||BARSSK=1,N)<100+1&&(ISLASTSP||NOT(BARSBK>=1)&&NOT(BARSSK>=1))&&(C<(M+30)+0.7||C<(M+30)),SK;
- 文华客服:
C>=BKPRICE+3||C<=BKPRICE-5&&MA5<REF(MA5,1),SP;
C>=SKPRICE+5||C<=SKPRICE-3&&MA5>REF(MA5,1),BP;
AUTOFILTER;
MONO_SIGNAL;
- 网友回复:
程序C
MA5:MA(C,5);
N:=BARSLAST(DATE<>REF(DATE,1))+1;
NN:=REF(N,N);
M1:=REF(C,N);//昨天的收盘价为M1
M2:=REF(C,N+NN);//前天的收盘价为M2
M3:=REF(C,N+2*NN);//大前天的收盘价为M3
M4:=REF(C,N+3*NN);//前4天的收盘价为M4
M:IFELSE(M1>=M2&&M2>=M3||M1<=M2&&M2<=M3,M2,IFELSE(M2>=M1&&M1>=M3||M2<=M1&&M1<=M3,M1,
IFELSE(M2>=M3&&M3>=M1||M2<=M3&&M3<=M1,M3,
IFELSE(M3>=M1&&M1>=M2&&M2>=M4||M3<=M1&&M1<=M2&&M2<=M4,M1,NULL))));
COUNT(BARSBK=1||BARSSK=1,N)<100+1&&(ISLASTBP||NOT(BARSBK>=1)&&NOT(BARSSK>=1))&&(C>(M-10)+0.7||C>(M-10)),BK;
COUNT(BARSBK=1||BARSSK=1,N)<100+1&&(ISLASTSP||NOT(BARSBK>=1)&&NOT(BARSSK>=1))&&(C<(M-10)+0.7||C<(M-10)),SK;
- 网友回复:
C>=BKPRICE+3||C<=BKPRICE-5&&MA5<REF(MA5,1),SP;
C>=SKPRICE+5||C<=SKPRICE-3&&MA5>REF(MA5,1),BP;
AUTOFILTER;
MONO_SIGNAL;
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 511411198 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容