网友求助:
请老师帮我把预测牛股中的“小牛”做个选股公式,谢谢!
源码:短牛:=9;中线:=9;周期:=15;过滤:=8;选股:=-26;抄底:=-30;
VAR11102:=MA(CLOSE,5);
VAR11103:=MA(CLOSE,10);
VAR11104:=MA(CLOSE,20);
VAR11105:=MA(CLOSE,30);
VAR11106:=(VAR11102 + VAR11103 + VAR11104 + VAR11105)/(4);
VAR11107:=((VAR11106 - REF(VAR11106,周期))/(REF(VAR11106,周期)))*(100);
VAR11108:=((VAR11106 - REF(VAR11106,周期))/(REF(VAR11106,周期)))*(100);
VAR11109:=EMA(VAR11107,过滤);
小买:=IF((TROUGHBARS(3,15,1) = 0) and (HIGH > LOW + 0.01) and (DATE <= 108088515),50,0);
VAR111010:=((CLOSE - MA(CLOSE,58))/(MA(CLOSE,58)))*(100);
VAR111011:=((VAR111010 > (1)*(REF(VAR111010,1))) and (VAR111010 < 选股) and (VAR111010 > 抄底))*(1.5);
VAR111012:=((VOL)/(CAPITAL))*(100);
VAR111013:=LLVBARS(LOW,50);
VAR111014:=SUM(VOL,VAR111013);
VAR111015:=HHVBARS(HIGH,50);
VAR111016:=SUM(VOL,VAR111015);
VAR111017:=((CLOSE - REF(OPEN,VAR111015))/(REF(OPEN,VAR111015)))*(100);
VAR111018:=((VAR111016)/(CAPITAL))*(100);
VAR111019:=((CLOSE - REF(OPEN,VAR111013))/(REF(OPEN,VAR111013)))*(100);
VAR111020:=((VAR111014)/(CAPITAL))*(100);
VAR111021:=MA(CLOSE,3);
VAR111022:=(REF(CLOSE,2))*(0.865);
VAR111023:=(REF(CLOSE,13))*(0.772);
VAR111024:=MIN(VAR111022,VAR111023);
VAR111025:=MA(CLOSE,13);
DRAWTEXTABS(300,2,''),COLOR889999,LINETHICK3;
大买:=(IF(((CLOSE - VAR111024)/(CLOSE) < 0.03) and (VAR111017 < (-35)) and ((SUM(VAR111012,5))/(5) < 1.8) and (DATE <= 108880515),1,0))*(100);
豪买:IF((大买 = 100) and (小买 = 50) and (DATE <= 108880515),168,0),COlorred;
解答如下:
短牛:=9;中线:=9;周期:=15;过滤:=8;选股:=-26;抄底:=-30;
VAR22:=MA(CLOSE,5);
VAR23:=MA(CLOSE,10);
VAR24:=MA(CLOSE,30);
VAR25:=MA(CLOSE,60);
VAR26:=EMA(COST(85),7);
VAR27:=EMA(COST(15),7);
VAR60:=(SUM(((CLOSE)*(VOL))*(100),4))/(SUM((VOL)*(100),4));
VAR61:=(INTPART((VAR60)*(100)))/(100);
VAR62:=(SUM(((CLOSE)*(VOL))*(100),7))/(SUM((VOL)*(100),7));
VAR63:=(INTPART((VAR62)*(100)))/(100);
VAR64:=(SUM(((CLOSE)*(VOL))*(100),28))/(SUM((VOL)*(100),28));
VAR65:=(INTPART((VAR64)*(100)))/(100);
B:=IF((DATE <= 108880515),EMA(CLOSE,5) - EMA(CLOSE,10),0);
A:=IF((DATE <= 108088515),EMA(B,中线),0);
VAR28:=(((-100))*(HHV(CLOSE,5) - CLOSE))/(HHV(CLOSE,5) - LLV(LOW,5)) + 100;
VAR29:=(((-100))*(HHV(CLOSE,10) - CLOSE))/(HHV(CLOSE,10) - LLV(LOW,10)) + 100;
VAR30:=(((-100))*(HHV(CLOSE,20) - CLOSE))/(HHV(CLOSE,20) - LLV(LOW,20)) + 100;
VAR31:=(((-100))*(HHV(CLOSE,30) - CLOSE))/(HHV(CLOSE,30) - LLV(LOW,30)) + 100;
VAR32:=REF(A,1);
VAR33:=A;
VAR34:=VAR33 - VAR32;
VAR35:=REF(B,1);
VAR36:=B;
VAR37:=VAR36 - VAR35;
VAR50:=OPEN;
VAR51:=CLOSE;
小牛:(VAR50 <= VAR22) AND (VAR50 <= VAR23) AND (VAR50 <= VAR24) AND (VAR51 >= VAR22) AND (VAR51 >= VAR65) AND (VAR34 > 0) AND (VAR37 > 0);